diff options
author | Guido Vranken <guidovranken@gmail.com> | 2016-09-22 22:48:44 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-02-14 14:52:24 -0500 |
commit | 873019f2c3d5d19f761b0f6e8dbc8d439345fd6f (patch) | |
tree | c035b0a5d97e0df43776e12ce1cb9ed55ab838f4 /crypto | |
parent | 57b0d651f052ed86528da916397acbcce035fb21 (diff) |
Prevents that OPENSSL_gmtime incorrectly signals success if gmtime_r fails, and that struct* tm result's possibly uninitialized content is used
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1613)
Diffstat (limited to 'crypto')
-rwxr-xr-x | crypto/o_time.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/o_time.c b/crypto/o_time.c index e785525b3f..bf74150f33 100755 --- a/crypto/o_time.c +++ b/crypto/o_time.c @@ -56,7 +56,8 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) * should return &data, but doesn't on some systems, so we don't even * look at the return value */ - gmtime_r(timer, result); + if (gmtime_r(timer, result) == NULL) + return NULL; ts = result; #elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK) ts = gmtime(timer); |