[packages/glibc] - obsolete; 2.28 uses 64bit time_t for parsing even on 32bit architectures

arekm arekm at pld-linux.org
Wed Aug 1 10:28:55 CEST 2018


commit 2ff9b7274a25e5ed303f5b42e51f4a84a2967ea2
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Aug 1 10:28:48 2018 +0200

    - obsolete; 2.28 uses 64bit time_t for parsing even on 32bit architectures

 glibc-tzset-default.patch | 49 -----------------------------------------------
 1 file changed, 49 deletions(-)
---
diff --git a/glibc-tzset-default.patch b/glibc-tzset-default.patch
deleted file mode 100644
index 1aa61ca..0000000
--- a/glibc-tzset-default.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Avoid integer overflow when using TZ in form stdNdst without explicit dst rules,
-when:
- * using 32-bit time_t
- * first system timezone transition rule begins before 1901 (i.e. ~INT32_MAX)
- * TZ is on west of system timezone
---- glibc-2.27/time/tzfile.c.orig	2018-02-10 11:10:05.455102136 +0100
-+++ glibc-2.27/time/tzfile.c	2018-07-14 21:25:23.090397420 +0200
-@@ -543,6 +543,25 @@
-    We will use the names and offsets from the user, and the rules
-    from the TZDEFRULES file.  */
- 
-+static void time_adjust_limited(time_t *value, long diff)
-+{
-+  static time_t time_min = (sizeof(time_t) == 4) ? INT32_MIN : INT64_MIN;
-+  static time_t time_max = (sizeof(time_t) == 4) ? INT32_MAX : INT64_MAX;
-+  if (diff < 0)
-+  {
-+    if (*value >= time_min - diff)
-+      *value += diff;
-+    else
-+      *value = time_min;
-+  } else if (diff > 0)
-+  {
-+    if (*value <= time_max - diff)
-+      *value += diff;
-+    else
-+      *value = time_max;
-+  }
-+}
-+
- void
- __tzfile_default (const char *std, const char *dst,
- 		  long int stdoff, long int dstoff)
-@@ -590,13 +609,13 @@
- 	   wall clock time as of the previous transition was DST.  Correct
- 	   for the difference between the rule's DST offset and the user's
- 	   DST offset.  */
--	transitions[i] += dstoff - rule_dstoff;
-+	time_adjust_limited(&transitions[i], dstoff - rule_dstoff);
-       else
- 	/* This transition is in "local wall clock time", and wall clock
- 	   time as of this iteration is non-DST.  Correct for the
- 	   difference between the rule's standard offset and the user's
- 	   standard offset.  */
--	transitions[i] += stdoff - rule_stdoff;
-+	time_adjust_limited(&transitions[i], stdoff - rule_stdoff);
- 
-       /* The DST state of "local wall clock time" for the next iteration is
- 	 as specified by this transition.  */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/glibc.git/commitdiff/2ff9b7274a25e5ed303f5b42e51f4a84a2967ea2



More information about the pld-cvs-commit mailing list