]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't add FR_TYPE_NULL boxes to xlat output
authorNick Porter <nick@portercomputing.co.uk>
Fri, 18 Jul 2025 13:53:04 +0000 (14:53 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 18 Jul 2025 16:36:03 +0000 (17:36 +0100)
They currently can't be cast to anything so cause issues when assigning
to a target attribute

src/modules/rlm_redis/rlm_redis.c

index 6521d08d88511f6e055114742afd0f2217d4da19..067d9f0184f06409221dafe7e060db0abc576841 100644 (file)
@@ -555,10 +555,12 @@ static xlat_action_t redis_lua_func_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
        if (vb_out->type == FR_TYPE_GROUP) {
                fr_value_box_t  *child_vb = NULL;
-               while ((child_vb = fr_value_box_list_pop_head(&vb_out->vb_group))) fr_dcursor_append(out, child_vb);
+               while ((child_vb = fr_value_box_list_pop_head(&vb_out->vb_group))) {
+                       if (child_vb->type != FR_TYPE_NULL) fr_dcursor_append(out, child_vb);
+               }
                talloc_free(vb_out);
        } else {
-               fr_dcursor_append(out, vb_out);
+               if (vb_out->type != FR_TYPE_NULL) fr_dcursor_append(out, vb_out);
        }
 
 finish:
@@ -774,10 +776,12 @@ reply_parse:
 
        if (vb_out->type == FR_TYPE_GROUP) {
                fr_value_box_t  *child_vb = NULL;
-               while ((child_vb = fr_value_box_list_pop_head(&vb_out->vb_group))) fr_dcursor_append(out, child_vb);
+               while ((child_vb = fr_value_box_list_pop_head(&vb_out->vb_group))) {
+                       if (child_vb->type != FR_TYPE_NULL) fr_dcursor_append(out, child_vb);
+               }
                talloc_free(vb_out);
        } else {
-               fr_dcursor_append(out, vb_out);
+               if (vb_out->type != FR_TYPE_NULL) fr_dcursor_append(out, vb_out);
        }
 
 finish: