From 2287b81741d624be98b926d0fc61da38a4dc363e Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 2 Sep 2015 08:49:44 -0400 Subject: [PATCH] Use correct variable for check. Fixes #1205 --- src/main/pair.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/pair.c b/src/main/pair.c index 12bc0b92bc..4ec8dc6b7b 100644 --- a/src/main/pair.c +++ b/src/main/pair.c @@ -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. -- 2.47.3