From 954d8e4f79a804e2312e038ceefb4f40290da6d1 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 13 Mar 2003 14:10:11 +0000 Subject: [PATCH] Return an error if gmtime returns NULL. --- crypto/o_time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/o_time.c b/crypto/o_time.c index ca5f3ea48e..723eb1b5af 100644 --- a/crypto/o_time.c +++ b/crypto/o_time.c @@ -80,8 +80,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) ts = result; #elif !defined(OPENSSL_SYS_VMS) ts = gmtime(timer); - if (ts != NULL) - memcpy(result, ts, sizeof(struct tm)); + if (ts == NULL) + return NULL; + + memcpy(result, ts, sizeof(struct tm)); ts = result; #endif #ifdef OPENSSL_SYS_VMS -- 2.25.1