bpo-34672: Don't pass NULL to gmtime_r. (GH-9312)
authorBenjamin Peterson <benjamin@python.org>
Fri, 14 Sep 2018 17:39:13 +0000 (10:39 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Sep 2018 17:39:13 +0000 (10:39 -0700)
Modules/timemodule.c

index 8118b31c91730c78202f6317f13a3d9ae5c372a8..1a4cff23d65efd180f423f45935f3cf3e565fcfe 100644 (file)
@@ -1764,7 +1764,8 @@ PyInit_time(void)
 
 #if defined(__linux__) && !defined(__GLIBC__)
     struct tm tm;
-    if (gmtime_r(0, &tm) != NULL)
+    const time_t zero = 0;
+    if (gmtime_r(&zero, &tm) != NULL)
         utc_string = tm.tm_zone;
 #endif