]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Print errors from regex_exec
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 3 Jan 2015 19:13:14 +0000 (14:13 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 3 Jan 2015 19:31:06 +0000 (14:31 -0500)
src/main/realms.c

index 2691050c3b3632284310b2ff86a37d475435ddc0..ad65366fe73d8e134c07476c724d939eb6caf698 100644 (file)
@@ -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;
                }
        }