Prevents that OPENSSL_gmtime incorrectly signals success if gmtime_r fails, and that...
[openssl.git] / crypto / o_time.c
index e785525b3f9b86baff33879de6a8ec29027a278a..bf74150f33f47d6888a7336f225c2f97da6bf2a2 100755 (executable)
@@ -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);