o_time.c: use gmtime_s with MSVC
authorMiroslav Suk <miroslav.suk@eset.cz>
Thu, 22 Mar 2018 08:20:43 +0000 (09:20 +0100)
committerAndy Polyakov <appro@openssl.org>
Wed, 28 Mar 2018 20:46:31 +0000 (22:46 +0200)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5719)

crypto/o_time.c

index 6192743..a763b2c 100755 (executable)
@@ -109,6 +109,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
     if (gmtime_r(timer, result) == NULL)
         return NULL;
     ts = result;
+#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400
+    if (gmtime_s(result, timer))
+        return NULL;
+    ts = result;
 #elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK)
     ts = gmtime(timer);
     if (ts == NULL)