From 60dea9d187caa700e42f37c7955116f71be912d5 Mon Sep 17 00:00:00 2001 From: Andreas Henriksson Date: Mon, 28 Nov 2016 17:24:49 +0100 Subject: [PATCH] sulogin: make getpasswd(...) return NULL on ^D MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- login-utils/sulogin.c | 1 + 1 file changed, 1 insertion(+) 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 )) { -- 2.47.2