diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2014-02-02 03:44:33 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2014-02-02 03:44:33 +0000 |
commit | b5d9a0e1ebbdac0edd5313d53fda2a2bbb2f318f (patch) | |
tree | 0d1ea03044676ba7c2b6aa024d64a6c160161f7a /usr.bin/ssh/readpass.c | |
parent | fe55dfde82d2faf80a3ca92ba365c26ec5e2ad02 (diff) |
convert memset of potentially-private data to explicit_bzero()
Diffstat (limited to 'usr.bin/ssh/readpass.c')
-rw-r--r-- | usr.bin/ssh/readpass.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/ssh/readpass.c b/usr.bin/ssh/readpass.c index f3c5cbfbabe..b5a86d782a7 100644 --- a/usr.bin/ssh/readpass.c +++ b/usr.bin/ssh/readpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readpass.c,v 1.49 2013/05/17 00:13:14 djm Exp $ */ +/* $OpenBSD: readpass.c,v 1.50 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -96,13 +96,13 @@ ssh_askpass(char *askpass, const char *msg) break; signal(SIGCHLD, osigchld); if (ret == -1 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { - memset(buf, 0, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); return NULL; } buf[strcspn(buf, "\r\n")] = '\0'; pass = xstrdup(buf); - memset(buf, 0, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); return pass; } @@ -159,7 +159,7 @@ read_passphrase(const char *prompt, int flags) } ret = xstrdup(buf); - memset(buf, 'x', sizeof buf); + explicit_bzero(buf, sizeof(buf)); return ret; } |