ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 24d5c07d298d5681e2281e10d8a37106ee7f1eba
parent 1920516abfc72c1befa41d093cef9d87aa0e64d0
Author: sin <sin@2f30.org>
Date:   Wed, 30 Apr 2014 12:26:27 +0100

Use explicit_bzero() in su

Diffstat:
Msu.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/su.c b/su.c @@ -35,7 +35,6 @@ main(int argc, char *argv[]) struct spwd *spw; struct passwd *pw; uid_t uid; - int i; ARGBEGIN { case 'l': @@ -81,8 +80,7 @@ main(int argc, char *argv[]) eprintf("getpass:"); cryptpass = crypt(pass, spw->sp_pwdp); - for (i = 0; pass[i]; i++) - pass[i] = '\0'; + explicit_bzero(pass, strlen(pass)); if (!cryptpass) eprintf("crypt:");