summaryrefslogtreecommitdiff
path: root/sshbuf-misc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2016-01-14 15:07:14 +0000
committerColin Watson <cjwatson@debian.org>2016-01-14 15:07:14 +0000
commiteeff4de96f5d7365750dc56912c2c62b5c28db6b (patch)
tree87e6ba5620716a6a9c1cbf84786d81cf7373ad43 /sshbuf-misc.c
parent651211fd4a199b299540c00c54a46e27fadb04be (diff)
parentc88ac102f0eb89f2eaa314cb2e2e0ca3c890c443 (diff)
Import openssh_7.1p2.orig.tar.gz
Diffstat (limited to 'sshbuf-misc.c')
-rw-r--r--sshbuf-misc.c10
1 files changed, 5 insertions, 5 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}