Commit 873019f2 authored by Guido Vranken's avatar Guido Vranken Committed by Rich Salz
Browse files

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: default avatarRichard Levitte <levitte@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1613)
parent 57b0d651
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);