diff options
author | job <> | 2023-08-30 10:13:12 +0000 |
---|---|---|
committer | job <> | 2023-08-30 10:13:12 +0000 |
commit | 9939c389dea4955b2a84815d7c821f036c266e0f (patch) | |
tree | 349865618e700d8d04d72491432f8674d4cdb48f /src/lib | |
parent | 1aa9536098c9828d022dfa472e268174a5592d14 (diff) | |
download | openbsd-9939c389dea4955b2a84815d7c821f036c266e0f.tar.gz openbsd-9939c389dea4955b2a84815d7c821f036c266e0f.tar.bz2 openbsd-9939c389dea4955b2a84815d7c821f036c266e0f.zip |
Ensure no memory is leaked after passing NULL to ASN1_TIME_normalize()libressl-v3.8.1
OK tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index 9cdac73ff0..556e12a367 100644 --- a/src/lib/libcrypto/asn1/a_time_tm.c +++ b/src/lib/libcrypto/asn1/a_time_tm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_time_tm.c,v 1.29 2023/07/07 19:37:52 beck Exp $ */ | 1 | /* $OpenBSD: a_time_tm.c,v 1.30 2023/08/30 10:13:12 job Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -610,6 +610,8 @@ ASN1_TIME_normalize(ASN1_TIME *t) | |||
610 | { | 610 | { |
611 | struct tm tm; | 611 | struct tm tm; |
612 | 612 | ||
613 | if (t == NULL) | ||
614 | return 0; | ||
613 | if (!ASN1_TIME_to_tm(t, &tm)) | 615 | if (!ASN1_TIME_to_tm(t, &tm)) |
614 | return 0; | 616 | return 0; |
615 | return tm_to_rfc5280_time(&tm, t) != NULL; | 617 | return tm_to_rfc5280_time(&tm, t) != NULL; |