summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2017-09-19 12:10:30 +0000
committermillert <millert@openbsd.org>2017-09-19 12:10:30 +0000
commitf88ec34ed5728bf19bb98af5313c8d249ecbebef (patch)
tree45f9107cd6c8434526282b122aeceb9d98287aa8
parentfix fd leaks in error paths (diff)
downloadwireguard-openbsd-f88ec34ed5728bf19bb98af5313c8d249ecbebef.tar.xz
wireguard-openbsd-f88ec34ed5728bf19bb98af5313c8d249ecbebef.zip
Use explicit_bzero() instead of bzero() before free() to prevent
the compiler from optimizing away the bzero() call. OK djm@
-rw-r--r--usr.bin/ssh/channels.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index cc6ccce1c46..ab7bbfe66e6 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.370 2017/09/12 07:55:48 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.371 2017/09/19 12:10:30 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -563,7 +563,7 @@ channel_free(struct ssh *ssh, Channel *c)
if (c->filter_cleanup != NULL && c->filter_ctx != NULL)
c->filter_cleanup(ssh, c->self, c->filter_ctx);
sc->channels[c->self] = NULL;
- bzero(c, sizeof(*c));
+ explicit_bzero(c, sizeof(*c));
free(c);
}