From 52c4c51f02c1bec0440f520aa98765072d1f0286 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 13 Mar 2003 14:13:53 +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