Use explicit_bzero() in su

This commit is contained in:
sin 2014-04-30 12:26:27 +01:00
parent 1920516abf
commit 24d5c07d29
1 changed files with 1 additions and 3 deletions

4
su.c
View File

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