Use correct variable for check. Fixes #1205
authorAlan T. DeKok <aland@freeradius.org>
Wed, 2 Sep 2015 12:49:44 +0000 (08:49 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 2 Sep 2015 12:49:44 +0000 (08:49 -0400)
src/main/pair.c

index 12bc0b9..4ec8dc6 100644 (file)
@@ -110,14 +110,17 @@ int radius_compare_vps(UNUSED REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *v
                        goto regex_error;
                }
 
-               ret = regex_exec(preg, value_p, talloc_array_length(value_p) - 1, rxmatch, &nmatch);
-               if (ret < 0) {
+               slen = regex_exec(preg, value_p, talloc_array_length(value_p) - 1, rxmatch, &nmatch);
+               if (slen < 0) {
                        RERROR("%s", fr_strerror());
 
                        return -2;
                }
 
                if (check->op == T_OP_REG_EQ) {
+                       /*
+                        *      Add in %{0}. %{1}, etc.
+                        */
                        regex_sub_to_request(request, &preg, value_p, talloc_array_length(value_p) - 1,
                                             rxmatch, nmatch);
                        ret = (slen == 1) ? 0 : -1;
@@ -559,7 +562,6 @@ int paircompare(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check,
                        return -1;
                }
 
-
                /*
                 *      We've got to xlat the string before doing
                 *      the comparison.