Merge pull request #8 from henrikolsson/master
Prevent crash in passwordgood when supplied password is one character long
This commit is contained in:
commit
6753fd6eca
|
@ -2051,9 +2051,13 @@ newuser ()
|
|||
int
|
||||
passwordgood (char *cpw)
|
||||
{
|
||||
char *crypted;
|
||||
assert (me != NULL);
|
||||
|
||||
if (!strncmp (crypt (cpw, cpw), me->password, DGL_PASSWDLEN))
|
||||
crypted = crypt (cpw, cpw);
|
||||
if (crypted == NULL)
|
||||
return 0;
|
||||
if (!strncmp (crypted, me->password, DGL_PASSWDLEN))
|
||||
return 1;
|
||||
if (!strncmp (cpw, me->password, DGL_PASSWDLEN))
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue