From: Alan T. DeKok Date: Wed, 27 Sep 2023 23:42:30 +0000 (-0400) Subject: use input ctx, as output value-box may be on the stack X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fdb83ce3f085d71dcb09d31f3793a87e09f5306;p=thirdparty%2Ffreeradius-server.git use input ctx, as output value-box may be on the stack --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 5ff79618dfd..ff9d0449592 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -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;