diff options
author | jsg@openbsd.org <jsg@openbsd.org> | 2020-02-26 14:40:09 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-02-28 02:26:28 +0100 |
commit | d5ba1c03278eb079438bb038266d80d7477d49cb (patch) | |
tree | 6d8dd2d802af796bcb7c9d6d018196a448bb9ff6 /ssh-add.c | |
parent | upstream: Have sftp reject "-1" in the same way as ssh(1) and (diff) | |
download | openssh-d5ba1c03278eb079438bb038266d80d7477d49cb.tar.xz openssh-d5ba1c03278eb079438bb038266d80d7477d49cb.zip |
upstream: 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@
OpenBSD-Commit-ID: 2660fa334fcc7cd05ec74dd99cb036f9ade6384a
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 @@ -105,8 +105,7 @@ static void clear_pass(void) { if (pass) { - explicit_bzero(pass, strlen(pass)); - free(pass); + freezero(pass, strlen(pass)); pass = NULL; } } @@ -521,8 +520,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) { @@ -533,8 +531,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); } |