]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use input ctx, as output value-box may be on the stack
authorAlan T. DeKok <aland@freeradius.org>
Wed, 27 Sep 2023 23:42:30 +0000 (19:42 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 27 Sep 2023 23:42:30 +0000 (19:42 -0400)
src/lib/util/value.c

index 5ff79618dfdaa6aedef22895704a6e0e53e96458..ff9d0449592230caae9dd9e4504612e2b5ddab78 100644 (file)
@@ -5630,7 +5630,7 @@ int fr_value_box_list_concat_in_place(TALLOC_CTX *ctx,
                        }
                        (void)fr_sbuff_trim_talloc(&sbuff, SIZE_MAX);
                        if (vb_should_free_value(proc_action)) fr_value_box_clear_value(out);
-                       if (fr_value_box_bstrndup(out, out, NULL, fr_sbuff_buff(&sbuff), fr_sbuff_used(&sbuff), tainted) < 0) goto error;
+                       if (fr_value_box_bstrndup(ctx, out, NULL, fr_sbuff_buff(&sbuff), fr_sbuff_used(&sbuff), tainted) < 0) goto error;
                        break;
 
                case FR_TYPE_OCTETS:
@@ -5646,7 +5646,7 @@ int fr_value_box_list_concat_in_place(TALLOC_CTX *ctx,
                        }
                        (void)fr_dbuff_trim_talloc(&dbuff, SIZE_MAX);
                        if (vb_should_free_value(proc_action)) fr_value_box_clear_value(out);
-                       if (fr_value_box_memdup(out, out, NULL, fr_dbuff_buff(&dbuff), fr_dbuff_used(&dbuff), tainted) < 0) goto error;
+                       if (fr_value_box_memdup(ctx, out, NULL, fr_dbuff_buff(&dbuff), fr_dbuff_used(&dbuff), tainted) < 0) goto error;
                        break;
 
                default:
@@ -5670,7 +5670,7 @@ int fr_value_box_list_concat_in_place(TALLOC_CTX *ctx,
                        (void)fr_sbuff_trim_talloc(&sbuff, SIZE_MAX);
 
                        entry = out->entry;
-                       if (fr_value_box_bstrndup(out, out, NULL, fr_sbuff_buff(&sbuff), fr_sbuff_used(&sbuff), tainted) < 0) goto error;
+                       if (fr_value_box_bstrndup(ctx, out, NULL, fr_sbuff_buff(&sbuff), fr_sbuff_used(&sbuff), tainted) < 0) goto error;
                        out->entry = entry;
                        break;
 
@@ -5681,7 +5681,7 @@ int fr_value_box_list_concat_in_place(TALLOC_CTX *ctx,
                        (void)fr_dbuff_trim_talloc(&dbuff, SIZE_MAX);
 
                        entry = out->entry;
-                       if (fr_value_box_memdup(out, out, NULL, fr_dbuff_buff(&dbuff), fr_dbuff_used(&dbuff), tainted) < 0) goto error;
+                       if (fr_value_box_memdup(ctx, out, NULL, fr_dbuff_buff(&dbuff), fr_dbuff_used(&dbuff), tainted) < 0) goto error;
                        out->entry = entry;
                        break;