Commit 3f6b6b2b authored by venaas's avatar venaas Committed by venaas
Browse files

fixed segfault in findserver() when no server configured, and tried to remove a warning

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@279 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 74c3bbbc
......@@ -1879,6 +1879,8 @@ struct server *findserver(struct realm **realm, char *id, uint8_t acc) {
return NULL;
debug(DBG_DBG, "found matching realm: %s", (*realm)->name);
srvconf = choosesrvconf(acc ? (*realm)->accsrvconfs : (*realm)->srvconfs);
if (!srvconf)
return NULL;
if (!acc && !srvconf->servers)
adddynamicrealmserver(*realm, srvconf, id);
return srvconf->servers;
......@@ -2886,7 +2888,7 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id
if (!*realmname)
return;
for (s = realmname; *s; s++)
if (*s != '.' && *s != '-' && !isalnum(*s))
if (*s != '.' && *s != '-' && !isalnum((int)*s))
return;
pthread_mutex_lock(&realm->subrealms_mutex);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment