diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bitstr.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index f4ea96cd54..b81bf4fc81 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
@@ -194,8 +194,12 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) | |||
194 | c=(unsigned char *)OPENSSL_realloc_clean(a->data, | 194 | c=(unsigned char *)OPENSSL_realloc_clean(a->data, |
195 | a->length, | 195 | a->length, |
196 | w+1); | 196 | w+1); |
197 | if (c == NULL) return(0); | 197 | if (c == NULL) |
198 | if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length); | 198 | { |
199 | ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT,ERR_R_MALLOC_FAILURE); | ||
200 | return 0; | ||
201 | } | ||
202 | if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length); | ||
199 | a->data=c; | 203 | a->data=c; |
200 | a->length=w+1; | 204 | a->length=w+1; |
201 | } | 205 | } |