From: Dr. Stephen Henson Date: Thu, 13 Mar 2003 14:10:11 +0000 (+0000) Subject: Return an error if gmtime returns NULL. X-Git-Tag: OpenSSL_0_9_7b~55 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=954d8e4f79a804e2312e038ceefb4f40290da6d1;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