summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2017-03-10 15:16:21 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2017-03-10 15:16:21 +0000
commit002bcc4ad52001d3b873d26708453c6db69ccda0 (patch)
tree911e81983ba8f3eb73d247d682abc71d05bf5c89 /lib
parent771507bd4f294da9fdc9c875fe5d5ca0351db2ab (diff)
Switch CBB to use recallocarray() - this ensures that we do not leak
secrets via realloc(). ok inoguchi@
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/bs_cbb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/bs_cbb.c b/lib/libssl/bs_cbb.c
index 3f8e08e0e35..a84299f8a20 100644
--- a/lib/libssl/bs_cbb.c
+++ b/lib/libssl/bs_cbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs_cbb.c,v 1.13 2015/09/01 13:35:39 jsing Exp $ */
+/* $OpenBSD: bs_cbb.c,v 1.14 2017/03/10 15:16:20 jsing Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
@@ -110,7 +110,7 @@ cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out, size_t len)
if (newcap < base->cap || newcap < newlen)
newcap = newlen;
- newbuf = realloc(base->buf, newcap);
+ newbuf = recallocarray(base->buf, base->cap, newcap, 1);
if (newbuf == NULL)
return 0;