-/* $OpenBSD: sshbuf-misc.c,v 1.4 2015/03/24 20:03:44 markus Exp $ */
+/* $OpenBSD: sshbuf-misc.c,v 1.5 2015/10/05 17:11:21 djm Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL)
return NULL;
if ((r = b64_ntop(p, len, ret, plen)) == -1) {
- bzero(ret, plen);
+ explicit_bzero(ret, plen);
free(ret);
return NULL;
}
if ((p = malloc(plen)) == NULL)
return SSH_ERR_ALLOC_FAIL;
if ((nlen = b64_pton(b64, p, plen)) < 0) {
- bzero(p, plen);
+ explicit_bzero(p, plen);
free(p);
return SSH_ERR_INVALID_FORMAT;
}
if ((r = sshbuf_put(buf, p, nlen)) < 0) {
- bzero(p, plen);
+ explicit_bzero(p, plen);
free(p);
return r;
}
- bzero(p, plen);
+ explicit_bzero(p, plen);
free(p);
return 0;
}
-/* $OpenBSD: sshbuf.c,v 1.3 2015/01/20 23:14:00 deraadt Exp $ */
+/* $OpenBSD: sshbuf.c,v 1.4 2015/10/05 17:11:21 djm Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
return;
dont_free = buf->dont_free;
if (!buf->readonly) {
- bzero(buf->d, buf->alloc);
+ explicit_bzero(buf->d, buf->alloc);
free(buf->d);
}
bzero(buf, sizeof(*buf));