From d71035e2d1383780c11d98b866911cc97b2fd76b Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 21 Sep 2023 09:08:33 +1200 Subject: [PATCH] =?UTF-8?q?hdb:=20Initialize=20=E2=80=98tm=E2=80=99=20stru?= =?UTF-8?q?cture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘tm’ must be initialized prior to calling strptime(). Signed-off-by: Joseph Sutton --- lib/hx509/hxtool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hx509/hxtool.c b/lib/hx509/hxtool.c index 9dbb5ccb1..f61187163 100644 --- a/lib/hx509/hxtool.c +++ b/lib/hx509/hxtool.c @@ -2902,9 +2902,11 @@ ptime(const char *s) char *rest; int at_s; + memset(&at_tm, 0, sizeof at_tm); if ((rest = strptime(s, "%Y-%m-%dT%H:%M:%S", &at_tm)) != NULL && rest[0] == '\0') return mktime(&at_tm); + memset(&at_tm, 0, sizeof at_tm); if ((rest = strptime(s, "%Y%m%d%H%M%S", &at_tm)) != NULL && rest[0] == '\0') return mktime(&at_tm); if ((at_s = parse_time(s, "s")) != -1)