summaryrefslogtreecommitdiffstats
path: root/crypto/o_time.c
diff options
context:
space:
mode:
authorGuido Vranken <guidovranken@gmail.com>2016-09-22 22:48:44 +0200
committerRich Salz <rsalz@openssl.org>2017-02-14 20:52:24 +0100
commit873019f2c3d5d19f761b0f6e8dbc8d439345fd6f (patch)
treec035b0a5d97e0df43776e12ce1cb9ed55ab838f4 /crypto/o_time.c
parentUse TLSEXT_KEYNAME_LENGTH in tls_decrypt_ticket. (diff)
downloadopenssl-873019f2c3d5d19f761b0f6e8dbc8d439345fd6f.tar.xz
openssl-873019f2c3d5d19f761b0f6e8dbc8d439345fd6f.zip
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/o_time.c')
-rwxr-xr-xcrypto/o_time.c3
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);