summaryrefslogtreecommitdiffstats
path: root/sbin/init
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-02-22 06:27:20 +0000
committerkevlo <kevlo@FreeBSD.org>2012-02-22 06:27:20 +0000
commit1381e63d6caac1d5d064b60f6e2cb11bf0608e14 (patch)
tree456afe25d5d911e27dc003830e6ca01ed80dab54 /sbin/init
parent749a5f142f69ff02971e21c6dca8eab3f65d8de9 (diff)
downloadFreeBSD-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.c3
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");
}
OpenPOWER on IntegriCloud