]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allocate from the request, which is thread-safe. Helps with #3188
authorAlan T. DeKok <aland@freeradius.org>
Thu, 5 Aug 2021 15:22:12 +0000 (11:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 5 Aug 2021 15:22:12 +0000 (11:22 -0400)
The "check" item is taken from the "huntgroups" file.  It's in
a statically allocated list which doesn't change, and shouldn't
change during run-time.  Allocating memory in its context is
not thread-safe, and can cause issues

src/main/pair.c

index 2f736d74cf7ca2de6323fadae9780d2b8e3613c1..3725ba1e10ba5d8c8c58cf2fcc13df000e1cc0d1 100644 (file)
@@ -84,13 +84,13 @@ int radius_compare_vps(UNUSED REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *v
                if (check->da->type == PW_TYPE_STRING) {
                        expr_p = check->vp_strvalue;
                } else {
-                       expr_p = expr = vp_aprints_value(check, check, '\0');
+                       expr_p = expr = vp_aprints_value(request, check, '\0');
                }
 
                if (vp->da->type == PW_TYPE_STRING) {
                        value_p = vp->vp_strvalue;
                } else {
-                       value_p = value = vp_aprints_value(vp, vp, '\0');
+                       value_p = value = vp_aprints_value(request, vp, '\0');
                }
 
                if (!expr_p || !value_p) {