diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2003-03-13 14:10:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2003-03-13 14:10:11 +0000 |
commit | 954d8e4f79a804e2312e038ceefb4f40290da6d1 (patch) | |
tree | c40ef192e8081151adc2ee98f79847f7fd93d166 /crypto/o_time.c | |
parent | b575dff21af65691a3dd4e8e18e03dd004cbd76c (diff) |
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 |