summaryrefslogtreecommitdiff
path: root/sshbuf-misc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-06-07 10:19:23 +0100
committerColin Watson <cjwatson@debian.org>2020-06-07 10:19:23 +0100
commit202f5a676221c244cd450086c334c2b59f339e86 (patch)
treed2f90a3a9ce2b33485c271eab01a48f02ef6fb5a /sshbuf-misc.c
parentf0de78bd4f29fa688c5df116f3f9cd43543a76d0 (diff)
parent9ca7e9c861775dd6c6312bc8aaab687403d24676 (diff)
Import openssh_8.3p1.orig.tar.gz
Diffstat (limited to 'sshbuf-misc.c')
-rw-r--r--sshbuf-misc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c
index c0336e867..9b5aa208c 100644
--- a/sshbuf-misc.c
+++ b/sshbuf-misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf-misc.c,v 1.13 2020/01/25 23:28:06 djm Exp $ */ 1/* $OpenBSD: sshbuf-misc.c,v 1.14 2020/02/26 13:40:09 jsg Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -156,17 +156,14 @@ sshbuf_b64tod(struct sshbuf *buf, const char *b64)
156 if ((p = malloc(plen)) == NULL) 156 if ((p = malloc(plen)) == NULL)
157 return SSH_ERR_ALLOC_FAIL; 157 return SSH_ERR_ALLOC_FAIL;
158 if ((nlen = b64_pton(b64, p, plen)) < 0) { 158 if ((nlen = b64_pton(b64, p, plen)) < 0) {
159 explicit_bzero(p, plen); 159 freezero(p, plen);
160 free(p);
161 return SSH_ERR_INVALID_FORMAT; 160 return SSH_ERR_INVALID_FORMAT;
162 } 161 }
163 if ((r = sshbuf_put(buf, p, nlen)) < 0) { 162 if ((r = sshbuf_put(buf, p, nlen)) < 0) {
164 explicit_bzero(p, plen); 163 freezero(p, plen);
165 free(p);
166 return r; 164 return r;
167 } 165 }
168 explicit_bzero(p, plen); 166 freezero(p, plen);
169 free(p);
170 return 0; 167 return 0;
171} 168}
172 169