diff options
-rw-r--r-- | sshbuf-misc.c | 10 | ||||
-rw-r--r-- | sshbuf.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c index d022065f9..3da4b80e7 100644 --- a/sshbuf-misc.c +++ b/sshbuf-misc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshbuf-misc.c,v 1.4 2015/03/24 20:03:44 markus Exp $ */ | 1 | /* $OpenBSD: sshbuf-misc.c,v 1.5 2015/10/05 17:11:21 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller | 3 | * Copyright (c) 2011 Damien Miller |
4 | * | 4 | * |
@@ -103,7 +103,7 @@ sshbuf_dtob64(struct sshbuf *buf) | |||
103 | if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL) | 103 | if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL) |
104 | return NULL; | 104 | return NULL; |
105 | if ((r = b64_ntop(p, len, ret, plen)) == -1) { | 105 | if ((r = b64_ntop(p, len, ret, plen)) == -1) { |
106 | bzero(ret, plen); | 106 | explicit_bzero(ret, plen); |
107 | free(ret); | 107 | free(ret); |
108 | return NULL; | 108 | return NULL; |
109 | } | 109 | } |
@@ -122,16 +122,16 @@ sshbuf_b64tod(struct sshbuf *buf, const char *b64) | |||
122 | if ((p = malloc(plen)) == NULL) | 122 | if ((p = malloc(plen)) == NULL) |
123 | return SSH_ERR_ALLOC_FAIL; | 123 | return SSH_ERR_ALLOC_FAIL; |
124 | if ((nlen = b64_pton(b64, p, plen)) < 0) { | 124 | if ((nlen = b64_pton(b64, p, plen)) < 0) { |
125 | bzero(p, plen); | 125 | explicit_bzero(p, plen); |
126 | free(p); | 126 | free(p); |
127 | return SSH_ERR_INVALID_FORMAT; | 127 | return SSH_ERR_INVALID_FORMAT; |
128 | } | 128 | } |
129 | if ((r = sshbuf_put(buf, p, nlen)) < 0) { | 129 | if ((r = sshbuf_put(buf, p, nlen)) < 0) { |
130 | bzero(p, plen); | 130 | explicit_bzero(p, plen); |
131 | free(p); | 131 | free(p); |
132 | return r; | 132 | return r; |
133 | } | 133 | } |
134 | bzero(p, plen); | 134 | explicit_bzero(p, plen); |
135 | free(p); | 135 | free(p); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshbuf.c,v 1.3 2015/01/20 23:14:00 deraadt Exp $ */ | 1 | /* $OpenBSD: sshbuf.c,v 1.4 2015/10/05 17:11:21 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller | 3 | * Copyright (c) 2011 Damien Miller |
4 | * | 4 | * |
@@ -177,7 +177,7 @@ sshbuf_free(struct sshbuf *buf) | |||
177 | return; | 177 | return; |
178 | dont_free = buf->dont_free; | 178 | dont_free = buf->dont_free; |
179 | if (!buf->readonly) { | 179 | if (!buf->readonly) { |
180 | bzero(buf->d, buf->alloc); | 180 | explicit_bzero(buf->d, buf->alloc); |
181 | free(buf->d); | 181 | free(buf->d); |
182 | } | 182 | } |
183 | bzero(buf, sizeof(*buf)); | 183 | bzero(buf, sizeof(*buf)); |