From: Andreas Henriksson Date: Mon, 28 Nov 2016 16:24:49 +0000 (+0100) Subject: sulogin: make getpasswd(...) return NULL on ^D X-Git-Tag: v2.30-rc1~362 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60dea9d187caa700e42f37c7955116f71be912d5;p=thirdparty%2Futil-linux.git sulogin: make getpasswd(...) return NULL on ^D This makes the caller bail out early instead of evaluating the input as a password. Reported-by: Bjørn Mork Addresses: http://bugs.debian.org/846112 Signed-off-by: Andreas Henriksson --- diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index a44216bda0..806a967f05 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -695,6 +695,7 @@ static char *getpasswd(struct console *con) ptr--; break; case CEOF: + ret = NULL; goto quit; default: if ((size_t)(ptr - &pass[0]) >= (sizeof(pass) -1 )) {