From 9939c389dea4955b2a84815d7c821f036c266e0f Mon Sep 17 00:00:00 2001 From: job <> Date: Wed, 30 Aug 2023 10:13:12 +0000 Subject: Ensure no memory is leaked after passing NULL to ASN1_TIME_normalize() OK tb@ --- src/lib/libcrypto/asn1/a_time_tm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib') 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 @@ -/* $OpenBSD: a_time_tm.c,v 1.29 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: a_time_tm.c,v 1.30 2023/08/30 10:13:12 job Exp $ */ /* * Copyright (c) 2015 Bob Beck * @@ -610,6 +610,8 @@ ASN1_TIME_normalize(ASN1_TIME *t) { struct tm tm; + if (t == NULL) + return 0; if (!ASN1_TIME_to_tm(t, &tm)) return 0; return tm_to_rfc5280_time(&tm, t) != NULL; -- cgit v1.2.3-55-g6feb