From: Dr. Stephen Henson Date: Thu, 13 Mar 2003 14:13:53 +0000 (+0000) Subject: Return an error if gmtime returns NULL. X-Git-Tag: BEN_FIPS_TEST_1~38^2~263 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=52c4c51f02c1bec0440f520aa98765072d1f0286;p=oweals%2Fopenssl.git Return an error if gmtime returns NULL. --- 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