diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-02-22 06:27:20 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-02-22 06:27:20 +0000 |
commit | 1381e63d6caac1d5d064b60f6e2cb11bf0608e14 (patch) | |
tree | 456afe25d5d911e27dc003830e6ca01ed80dab54 /sbin/init | |
parent | 749a5f142f69ff02971e21c6dca8eab3f65d8de9 (diff) | |
download | FreeBSD-src-1381e63d6caac1d5d064b60f6e2cb11bf0608e14.zip FreeBSD-src-1381e63d6caac1d5d064b60f6e2cb11bf0608e14.tar.gz |
Handle NULL return from crypt(3). Mostly from DragonFly
Diffstat (limited to 'sbin/init')
-rw-r--r-- | sbin/init/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index e936a78..3167503 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -657,7 +657,8 @@ single_user(void) _exit(0); password = crypt(clear, pp->pw_passwd); bzero(clear, _PASSWORD_LEN); - if (strcmp(password, pp->pw_passwd) == 0) + if (password == NULL || + strcmp(password, pp->pw_passwd) == 0) break; warning("single-user login failed\n"); } |