]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib: use memzero where applicable
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 17 Sep 2022 16:03:46 +0000 (18:03 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 27 Sep 2022 14:52:06 +0000 (16:52 +0200)
Use memzero when operating in a buffer of known size to clear all bytes
and avoid leaking the size of the stored data.

src/sulogin.c

index 08feade2f31b22db286b094757a4df512bdfb607..2c5e094333d67cc81d93a76e0fe2e3841418e141 100644 (file)
@@ -216,7 +216,7 @@ static void catch_signals (unused int sig)
                sleep (2);
                (void) puts (_("Login incorrect"));
        }
-       strzero (pass);
+       memzero (pass, sizeof pass);
        (void) alarm (0);
        (void) signal (SIGALRM, SIG_DFL);
        environ = newenvp;      /* make new environment active */