diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_lib.c')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_lib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index 5d14a2780f..444a34c072 100644 --- a/src/lib/libcrypto/asn1/asn1_lib.c +++ b/src/lib/libcrypto/asn1/asn1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1_lib.c,v 1.36 2015/07/29 14:53:20 jsing Exp $ */ | 1 | /* $OpenBSD: asn1_lib.c,v 1.37 2016/03/06 18:05:00 beck 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 | * |
@@ -401,6 +401,8 @@ ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) | |||
401 | void | 401 | void |
402 | ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) | 402 | ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) |
403 | { | 403 | { |
404 | if (str->data != NULL) | ||
405 | explicit_bzero(str->data, str->length); | ||
404 | free(str->data); | 406 | free(str->data); |
405 | str->data = data; | 407 | str->data = data; |
406 | str->length = len; | 408 | str->length = len; |
@@ -434,8 +436,10 @@ ASN1_STRING_free(ASN1_STRING *a) | |||
434 | { | 436 | { |
435 | if (a == NULL) | 437 | if (a == NULL) |
436 | return; | 438 | return; |
437 | if (a->data && !(a->flags & ASN1_STRING_FLAG_NDEF)) | 439 | if (a->data != NULL && !(a->flags & ASN1_STRING_FLAG_NDEF)) { |
440 | explicit_bzero(a->data, a->length); | ||
438 | free(a->data); | 441 | free(a->data); |
442 | } | ||
439 | free(a); | 443 | free(a); |
440 | } | 444 | } |
441 | 445 | ||