mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
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)
This commit is contained in:
parent
57b0d651f0
commit
873019f2c3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user