parse_header_time(): Use privoxy_gmtime_r()
authorFabian Keil <fk@fabiankeil.de>
Sun, 7 Jun 2020 15:57:40 +0000 (17:57 +0200)
committerFabian Keil <fk@fabiankeil.de>
Mon, 8 Jun 2020 13:34:36 +0000 (15:34 +0200)
Previously the function would use gmtime() unlocked
if FEATURE_STRPTIME_SANITY_CHECKS was enabled ...

parsers.c

index 6b93b74..15abc40 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -4356,9 +4356,10 @@ static jb_err parse_header_time(const char *header_time, time_t *result)
          {
             char recreated_date[100];
             struct tm *tm;
          {
             char recreated_date[100];
             struct tm *tm;
+            struct tm storage;
             time_t result2;
 
             time_t result2;
 
-            tm = gmtime(result);
+            tm = privoxy_gmtime_r(result, &storage);
             if (!strftime(recreated_date, sizeof(recreated_date),
                time_formats[i], tm))
             {
             if (!strftime(recreated_date, sizeof(recreated_date),
                time_formats[i], tm))
             {