Use explicit_bzero() in su
This commit is contained in:
parent
1920516abf
commit
24d5c07d29
4
su.c
4
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:");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user