From: Alan T. DeKok Date: Thu, 2 Jun 2022 13:03:22 +0000 (-0400) Subject: update truthiness for value-box groups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c9b6351beae30f8ef3d2e75859d83a163962b15;p=thirdparty%2Ffreeradius-server.git update truthiness for value-box groups empty groups are false. non-empty groups are true. Any other structural types cannot exist in a value-box group. --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index 994a624166a..42178d7554f 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -608,7 +608,10 @@ static bool truthiness(fr_value_box_t const *in) switch (in->type) { case FR_TYPE_NULL: + return false; + case FR_TYPE_STRUCTURAL: + if (in->type == FR_TYPE_GROUP) return (fr_value_box_list_len(&in->vb_group) > 0); return false; case FR_TYPE_BOOL: