]> 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 19:00:01 +0000 (15:00 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 5 Aug 2021 19:00:24 +0000 (15:00 -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

Manual port of commit 7875ca06d1

src/lib/server/paircmp.c

index 2d05ad08ac70826f0a5cf694ac2ac779364cb88b..ca521872797e5ac43da50fd95c5fdeae33f04148 100644 (file)
@@ -244,14 +244,14 @@ int paircmp_pairs(UNUSED request_t *request, fr_pair_t *check, fr_pair_t *vp)
                if (check->vp_type == FR_TYPE_STRING) {
                        expr_p = check->vp_strvalue;
                } else {
-                       fr_value_box_aprint(check, &expr, &check->data, NULL);
+                       fr_value_box_aprint(request, &expr, &check->data, NULL);
                        expr_p = expr;
                }
 
                if (vp->vp_type == FR_TYPE_STRING) {
                        value_p = vp->vp_strvalue;
                } else {
-                       fr_value_box_aprint(vp, &value, &vp->data, NULL);
+                       fr_value_box_aprint(request, &value, &vp->data, NULL);
                        value_p = value;
                }