diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2003-03-13 15:13:53 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2003-03-13 15:13:53 +0100 |
commit | 52c4c51f02c1bec0440f520aa98765072d1f0286 (patch) | |
tree | 47930fcd7241a01e119955c89e6243f96f5f3e73 /crypto/o_time.c | |
parent | Avoid warnings for no-engine and PEDANTIC (diff) | |
download | openssl-52c4c51f02c1bec0440f520aa98765072d1f0286.tar.xz openssl-52c4c51f02c1bec0440f520aa98765072d1f0286.zip |
Return an error if gmtime returns NULL.
Diffstat (limited to 'crypto/o_time.c')
-rw-r--r-- | crypto/o_time.c | 6 |
1 files 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 |