diff options
author | 2018-05-13 13:48:08 +0000 | |
---|---|---|
committer | 2018-05-13 13:48:08 +0000 | |
commit | f9ee4a4a9c78bbef207e5f3c8c582306fea817b5 (patch) | |
tree | d81853a8dff38f8b31d6887fae02ded0e4ed32af /lib/libcrypto/asn1/a_bitstr.c | |
parent | Add const qualifiers to the 'pass' and 'name' arguments of (diff) | |
download | wireguard-openbsd-f9ee4a4a9c78bbef207e5f3c8c582306fea817b5.tar.xz wireguard-openbsd-f9ee4a4a9c78bbef207e5f3c8c582306fea817b5.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 'lib/libcrypto/asn1/a_bitstr.c')
-rw-r--r-- | lib/libcrypto/asn1/a_bitstr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrypto/asn1/a_bitstr.c b/lib/libcrypto/asn1/a_bitstr.c index 7fa5af9bbba..11771bdd026 100644 --- a/lib/libcrypto/asn1/a_bitstr.c +++ b/lib/libcrypto/asn1/a_bitstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_bitstr.c,v 1.27 2018/05/12 17:44:31 jsing Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.28 2018/05/13 13:48:08 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -190,8 +190,6 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) return (NULL); } -/* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de> - */ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) { @@ -212,8 +210,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) if ((a->length < (w + 1)) || (a->data == NULL)) { if (!value) return(1); /* Don't need to set */ - c = OPENSSL_realloc_clean(a->data, a->length, w + 1); - if (c == NULL) { + if ((c = recallocarray(a->data, a->length, w + 1, 1)) == NULL) { ASN1error(ERR_R_MALLOC_FAILURE); return 0; } |