summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1/f_int.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-05-13 13:48:09 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-05-13 13:48:09 +0000
commitda95a920f88e84e199046ae61fb257b87d10c148 (patch)
tree32d6004262f6ce7326327b511d710990b191982a /lib/libcrypto/asn1/f_int.c
parent428bd889a7b149d269a69cae4961b97eee2f6b80 (diff)
Use recallocarray() instead of OPENSSL_realloc_clean().
Also place all of the OPENSSL_* memory related prototypes under #ifndef LIBRESSL_INTERNAL. ok beck@ tb@
Diffstat (limited to 'lib/libcrypto/asn1/f_int.c')
-rw-r--r--lib/libcrypto/asn1/f_int.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libcrypto/asn1/f_int.c b/lib/libcrypto/asn1/f_int.c
index 9849a7c8fca..d03fafe87d3 100644
--- a/lib/libcrypto/asn1/f_int.c
+++ b/lib/libcrypto/asn1/f_int.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: f_int.c,v 1.19 2018/04/25 11:48:21 tb Exp $ */
+/* $OpenBSD: f_int.c,v 1.20 2018/05/13 13:48:08 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -158,8 +158,7 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
}
i /= 2;
if (num + i > slen) {
- sp = OPENSSL_realloc_clean(s, slen, num + i);
- if (sp == NULL) {
+ if ((sp = recallocarray(s, slen, num + i, 1)) == NULL) {
ASN1error(ERR_R_MALLOC_FAILURE);
goto err;
}