summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/f_int.c
diff options
context:
space:
mode:
authorjsing <>2018-05-13 13:48:08 +0000
committerjsing <>2018-05-13 13:48:08 +0000
commit294ab72401fb4b21de1eb8cfc698fba7c7f676f9 (patch)
tree96ffa806e6015ca7656a37095f52d0238b382a31 /src/lib/libcrypto/asn1/f_int.c
parent5c4fd695e4ce135d2abc9d0272d5dcc6c5ca68be (diff)
downloadopenbsd-294ab72401fb4b21de1eb8cfc698fba7c7f676f9.tar.gz
openbsd-294ab72401fb4b21de1eb8cfc698fba7c7f676f9.tar.bz2
openbsd-294ab72401fb4b21de1eb8cfc698fba7c7f676f9.zip
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 'src/lib/libcrypto/asn1/f_int.c')
-rw-r--r--src/lib/libcrypto/asn1/f_int.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c
index 9849a7c8fc..d03fafe87d 100644
--- a/src/lib/libcrypto/asn1/f_int.c
+++ b/src/lib/libcrypto/asn1/f_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: f_int.c,v 1.19 2018/04/25 11:48:21 tb Exp $ */ 1/* $OpenBSD: f_int.c,v 1.20 2018/05/13 13:48:08 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -158,8 +158,7 @@ a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
158 } 158 }
159 i /= 2; 159 i /= 2;
160 if (num + i > slen) { 160 if (num + i > slen) {
161 sp = OPENSSL_realloc_clean(s, slen, num + i); 161 if ((sp = recallocarray(s, slen, num + i, 1)) == NULL) {
162 if (sp == NULL) {
163 ASN1error(ERR_R_MALLOC_FAILURE); 162 ASN1error(ERR_R_MALLOC_FAILURE);
164 goto err; 163 goto err;
165 } 164 }