Commit a1bd5032 authored by Pekka Pessi's avatar Pekka Pessi

auth_module.c: fixed klocwork issues

darcs-hash:20080522143836-65a35-25787c46de040decc0d6794b943ea50128bece5d.gz
parent 3fe6b552
......@@ -537,11 +537,10 @@ void auth_method_basic(auth_mod_t *am,
if (n < 0 || n >= INT_MAX)
continue;
if (n >= upsize) {
upsize = n + 1;
userpass = realloc(userpass == buffer ? NULL : userpass, upsize);
if (userpass == NULL)
continue;
base64_d(userpass, upsize - 1, au->au_params[0]);
void *b = realloc(userpass == buffer ? NULL : userpass, upsize = n + 1);
if (b == NULL)
break;
base64_d(userpass = b, upsize - 1, au->au_params[0]);
}
userpass[n] = 0;
if (!(pass = strchr(userpass, ':')))
......@@ -1079,13 +1078,15 @@ int auth_readdb_internal(auth_mod_t *am, int always)
if (!*pass || !*user)
continue;
realm = ""; ident = "";
if ((realm = strchr(pass, ':'))) {
if ((realm = strchr(pass, ':')))
*realm++ = '\0';
if ((ident = strchr(realm, ':')))
*ident++ = '\0';
}
else
realm = "";
if ((ident = strchr(realm, ':')))
*ident++ = '\0';
else
ident = "";
apw = fresh + i++;
......
Markdown is supported
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