diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/asn1/a_time_tm.c | 4 | ||||
| -rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1time.c | 5 |
2 files changed, 7 insertions, 2 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; |
diff --git a/src/regress/lib/libcrypto/asn1/asn1time.c b/src/regress/lib/libcrypto/asn1/asn1time.c index 0adac08300..65c36dfb01 100644 --- a/src/regress/lib/libcrypto/asn1/asn1time.c +++ b/src/regress/lib/libcrypto/asn1/asn1time.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: asn1time.c,v 1.16 2022/09/05 21:06:31 tb Exp $ */ | 1 | /* $OpenBSD: asn1time.c,v 1.17 2023/08/30 10:13:12 job Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -528,5 +528,8 @@ main(int argc, char **argv) | |||
| 528 | failed |= asn1_time_test(i, att, V_ASN1_GENERALIZEDTIME); | 528 | failed |= asn1_time_test(i, att, V_ASN1_GENERALIZEDTIME); |
| 529 | } | 529 | } |
| 530 | 530 | ||
| 531 | /* Check for a leak in ASN1_TIME_normalize(). */ | ||
| 532 | failed |= ASN1_TIME_normalize(NULL) != 0; | ||
| 533 | |||
| 531 | return (failed); | 534 | return (failed); |
| 532 | } | 535 | } |
