From: Christian Göttsche Date: Mon, 25 Apr 2022 10:17:40 +0000 (+0200) Subject: passwd: erase password copy on all error branches X-Git-Tag: 4.12~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58b6e97a9eef866e9e479fb781aaaf59fb11ef36;p=thirdparty%2Fshadow.git passwd: erase password copy on all error branches --- diff --git a/src/passwd.c b/src/passwd.c index 80531ec6d..8c6f81a91 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -289,6 +289,7 @@ static int new_password (const struct passwd *pw) cp = getpass (_("New password: ")); if (NULL == cp) { memzero (orig, sizeof orig); + memzero (pass, sizeof pass); return -1; } if (warned && (strcmp (pass, cp) != 0)) { @@ -316,6 +317,7 @@ static int new_password (const struct passwd *pw) cp = getpass (_("Re-enter new password: ")); if (NULL == cp) { memzero (orig, sizeof orig); + memzero (pass, sizeof pass); return -1; } if (strcmp (cp, pass) != 0) {