提交 873019f2 编写于 作者: G Guido Vranken 提交者: Rich Salz

Prevents that OPENSSL_gmtime incorrectly signals success if gmtime_r fails,...

Prevents that OPENSSL_gmtime incorrectly signals success if gmtime_r fails, and that struct* tm result's possibly uninitialized content is used
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1613)
上级 57b0d651
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册