diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_lib.c')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_lib.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index a90873d54a..852644a781 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.38 2017/01/29 17:49:22 beck Exp $ */ | 1 | /* $OpenBSD: asn1_lib.c,v 1.39 2017/05/02 03:59:44 deraadt 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,9 +401,7 @@ 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) | 404 | freezero(str->data, str->length); |
405 | explicit_bzero(str->data, str->length); | ||
406 | free(str->data); | ||
407 | str->data = data; | 405 | str->data = data; |
408 | str->length = len; | 406 | str->length = len; |
409 | } | 407 | } |
@@ -436,10 +434,8 @@ ASN1_STRING_free(ASN1_STRING *a) | |||
436 | { | 434 | { |
437 | if (a == NULL) | 435 | if (a == NULL) |
438 | return; | 436 | return; |
439 | if (a->data != NULL && !(a->flags & ASN1_STRING_FLAG_NDEF)) { | 437 | if (a->data != NULL && !(a->flags & ASN1_STRING_FLAG_NDEF)) |
440 | explicit_bzero(a->data, a->length); | 438 | freezero(a->data, a->length); |
441 | free(a->data); | ||
442 | } | ||
443 | free(a); | 439 | free(a); |
444 | } | 440 | } |
445 | 441 | ||