]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authormillert@openbsd.org <millert@openbsd.org>
Tue, 19 Sep 2017 12:10:30 +0000 (12:10 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 21 Sep 2017 23:14:53 +0000 (09:14 +1000)
Use explicit_bzero() instead of bzero() before free() to
prevent the compiler from optimizing away the bzero() call.  OK djm@

Upstream-ID: cdc6197e64c9684c7250e23d60863ee1b53cef1d

channels.c

index 72f0e7709a2bf9171dba5f2f9821cd881e399033..89b7d34864d9a78e1bf5c604c00ae481761331db 100644 (file)
@@ -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
@@ -573,7 +573,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);
 }