diff options
| author | jsing <> | 2018-05-13 13:48:08 +0000 |
|---|---|---|
| committer | jsing <> | 2018-05-13 13:48:08 +0000 |
| commit | 675abe1d8052e9013aafab06d42a244160518f8c (patch) | |
| tree | 96ffa806e6015ca7656a37095f52d0238b382a31 /src/lib/libcrypto/asn1/a_bitstr.c | |
| parent | 1903f850c0769bfd90bc9627f2e910d7c2ce4ccd (diff) | |
| download | openbsd-675abe1d8052e9013aafab06d42a244160518f8c.tar.gz openbsd-675abe1d8052e9013aafab06d42a244160518f8c.tar.bz2 openbsd-675abe1d8052e9013aafab06d42a244160518f8c.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/a_bitstr.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index 7fa5af9bbb..11771bdd02 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: a_bitstr.c,v 1.27 2018/05/12 17:44:31 jsing Exp $ */ | 1 | /* $OpenBSD: a_bitstr.c,v 1.28 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 | * |
| @@ -190,8 +190,6 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) | |||
| 190 | return (NULL); | 190 | return (NULL); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | /* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de> | ||
| 194 | */ | ||
| 195 | int | 193 | int |
| 196 | ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) | 194 | ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) |
| 197 | { | 195 | { |
| @@ -212,8 +210,7 @@ ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) | |||
| 212 | if ((a->length < (w + 1)) || (a->data == NULL)) { | 210 | if ((a->length < (w + 1)) || (a->data == NULL)) { |
| 213 | if (!value) | 211 | if (!value) |
| 214 | return(1); /* Don't need to set */ | 212 | return(1); /* Don't need to set */ |
| 215 | c = OPENSSL_realloc_clean(a->data, a->length, w + 1); | 213 | if ((c = recallocarray(a->data, a->length, w + 1, 1)) == NULL) { |
| 216 | if (c == NULL) { | ||
| 217 | ASN1error(ERR_R_MALLOC_FAILURE); | 214 | ASN1error(ERR_R_MALLOC_FAILURE); |
| 218 | return 0; | 215 | return 0; |
| 219 | } | 216 | } |
