From: Arran Cudbard-Bell Date: Sat, 3 Jan 2015 19:13:14 +0000 (-0500) Subject: Print errors from regex_exec X-Git-Tag: release_3_0_7~365 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5732e5c7aab67b270c4fbc10b076d0a0eefdcecc;p=thirdparty%2Ffreeradius-server.git Print errors from regex_exec --- diff --git a/src/main/realms.c b/src/main/realms.c index 2691050c3b3..ad65366fe73 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -1921,7 +1921,7 @@ int realm_realm_add(REALM *r, UNUSED CONF_SECTION *cs) /* * Include substring matches. */ - slen = regex_compile(r, &rr->preg, r->name + 1, strlen(r->name) - 1, true, true, false); + slen = regex_compile(rr, &rr->preg, r->name + 1, strlen(r->name) - 1, true, false, false); if (slen <= 0) { char *spaces, *text; @@ -2192,6 +2192,10 @@ REALM *realm_find(char const *name) int compare; compare = regex_exec(this->preg, name, strlen(name), NULL, NULL); + if (compare < 0) { + ERROR("Failed performing realm comparison: %s", fr_strerror()); + return NULL; + } if (compare == 1) return this->realm; } }