return -1;
}
+ memset(&rxmatch, 0, sizeof(rxmatch)); /* regexec does not seem to initialise unused elements */
compare = regexec(®, lhs, REQUEST_MAX_REGEX + 1, rxmatch, 0);
regfree(®);
rad_regcapture(request, compare, lhs, rxmatch);
len = rxmatch[i].rm_eo - rxmatch[i].rm_so;
p = talloc_array(request, char, len + 1);
+ if (!p) {
+ ERROR("Out of memory");
+ return;
+ }
+
memcpy(p, value + rxmatch[i].rm_so, len);
p[len] = '\0';
RDEBUG("Invalid regular expression %s: %s", check->vp_strvalue, buffer);
return -2;
}
+
+ memset(&rxmatch, 0, sizeof(rxmatch)); /* regexec does not seem to initialise unused elements */
compare = regexec(®, value, REQUEST_MAX_REGEX + 1, rxmatch, 0);
regfree(®);
rad_regcapture(request, compare, value, rxmatch);