diff options
author | 2020-02-26 13:40:09 +0000 | |
---|---|---|
committer | 2020-02-26 13:40:09 +0000 | |
commit | c9831b39c7f05cf54db0775dea423b6be448db6e (patch) | |
tree | f50d8c53bee8b027f393d63b6867f7cdcf2c7a4b /usr.bin/ssh/ssh-add.c | |
parent | Have sftp reject "-1" in the same way as ssh(1) and scp(1) do instead (diff) | |
download | wireguard-openbsd-c9831b39c7f05cf54db0775dea423b6be448db6e.tar.xz wireguard-openbsd-c9831b39c7f05cf54db0775dea423b6be448db6e.zip |
change explicit_bzero();free() to freezero()
While freezero() returns early if the pointer is NULL the tests for
NULL in callers are left to avoid warnings about passing an
uninitialised size argument across a function boundry.
ok deraadt@ djm@
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r-- | usr.bin/ssh/ssh-add.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c index eac8fafb946..a4c04317449 100644 --- a/usr.bin/ssh/ssh-add.c +++ b/usr.bin/ssh/ssh-add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-add.c,v 1.153 2020/02/18 08:58:33 dtucker Exp $ */ +/* $OpenBSD: ssh-add.c,v 1.154 2020/02/26 13:40:09 jsg Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -98,8 +98,7 @@ static void clear_pass(void) { if (pass) { - explicit_bzero(pass, strlen(pass)); - free(pass); + freezero(pass, strlen(pass)); pass = NULL; } } @@ -514,8 +513,7 @@ lock_agent(int agent_fd, int lock) fprintf(stderr, "Passwords do not match.\n"); passok = 0; } - explicit_bzero(p2, strlen(p2)); - free(p2); + freezero(p2, strlen(p2)); } if (passok) { if ((r = ssh_lock_agent(agent_fd, lock, p1)) == 0) { @@ -526,8 +524,7 @@ lock_agent(int agent_fd, int lock) lock ? "" : "un", ssh_err(r)); } } - explicit_bzero(p1, strlen(p1)); - free(p1); + freezero(p1, strlen(p1)); return (ret); } |