diff options
| author | venaas <venaas> | 2008-06-04 07:11:51 +0000 | 
|---|---|---|
| committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-06-04 07:11:51 +0000 | 
| commit | 3f6b6b2b4e0441d2c58bf285478cdee78bea4f05 (patch) | |
| tree | e44ecafc38b67f93f7c339ebd1fb16615b72d5b7 | |
| parent | 74c3bbbc0ba0967b85704cf9d6d1850c053193ca (diff) | |
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
| -rw-r--r-- | radsecproxy.c | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/radsecproxy.c b/radsecproxy.c index b6a278d..734165a 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -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); | 
