]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Default to "" args instead of NULL to avoid some crashes
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 17:47:06 +0000 (20:47 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 17:47:06 +0000 (20:47 +0300)
--HG--
branch : HEAD

src/auth/passdb.c
src/auth/userdb.c

index f62689d72028ddd3dba19e8bfba762a3a05e86df..af95276cae3868d386a3864a52b2a15f9de97083 100644 (file)
@@ -104,7 +104,8 @@ void passdb_init(void)
        args = strchr(name, ' ');
        name = t_strcut(name, ' ');
 
-       while (args != NULL && (*args == ' ' || *args == '\t'))
+       if (args == NULL) args = "";
+       while (*args == ' ' || *args == '\t')
                args++;
 
 #ifdef PASSDB_PASSWD
index 9395b1e6e962f10274bbe33a93ae2dc8a4a437b8..0dc3b87003bd663990ef2304b8b5e42dfbcc849d 100644 (file)
@@ -25,7 +25,8 @@ void userdb_init(void)
        args = strchr(name, ' ');
        name = t_strcut(name, ' ');
 
-       while (args != NULL && (*args == ' ' || *args == '\t'))
+       if (args == NULL) args = "";
+       while (*args == ' ' || *args == '\t')
                args++;
 
 #ifdef USERDB_PASSWD