]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't use stack-local buffer
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Dec 2023 21:11:10 +0000 (16:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Dec 2023 22:28:47 +0000 (17:28 -0500)
src/lib/server/pairmove.c

index 4933b0b97da0449d00785bb639cb1441344f7f69..ba1e5ca012927d21f59ca8675ddbe2233577a8f2 100644 (file)
@@ -446,7 +446,7 @@ int radius_legacy_map_cmp(request_t *request, map_t const *map)
        fr_pair_t *vp;
        fr_value_box_t const *box;
        fr_value_box_t *to_free = NULL;
-       fr_value_box_t dst;
+       fr_value_box_t dst, str;
 
        fr_assert(tmpl_is_attr(map->lhs));
        fr_assert(fr_comparison_op[map->op]);
@@ -474,7 +474,8 @@ int radius_legacy_map_cmp(request_t *request, map_t const *map)
                /*
                 *      @todo - why box it and parse it again, when we can just run the regex?
                 */
-               box = fr_box_strvalue(map->rhs->name);
+               fr_value_box_strdup_shallow(&str, NULL, map->rhs->name, false);
+               box = &str;
 
        } else {
                fr_strerror_const("Unknown RHS");