]> git.pld-linux.org Git - packages/glibc.git/commitdiff
- added tzset-default patch (fixes python-dateutil test failures)
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 14 Jul 2018 20:34:02 +0000 (22:34 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 14 Jul 2018 20:34:02 +0000 (22:34 +0200)
- release 12

glibc-tzset-default.patch [new file with mode: 0644]
glibc.spec

diff --git a/glibc-tzset-default.patch b/glibc-tzset-default.patch
new file mode 100644 (file)
index 0000000..e17d983
--- /dev/null
@@ -0,0 +1,49 @@
+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 east 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 long time_min = (sizeof(time_t) == 4) ? INT32_MIN : INT64_MIN;
++  static long 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.  */
index ce22eee2f5dad78fc4ed4841d0a10f41287beefe..58d6130f6ba1f84ea4a4ea0d0d0ff9aaaae5ed7a 100644 (file)
@@ -41,7 +41,7 @@ Summary(tr.UTF-8):    GNU libc
 Summary(uk.UTF-8):     GNU libc версії
 Name:          glibc
 Version:       %{core_version}
-Release:       11
+Release:       12
 Epoch:         6
 License:       LGPL v2.1+
 Group:         Libraries
@@ -66,7 +66,7 @@ Patch3:               %{name}-crypt-blowfish.patch
 Patch4:                %{name}-no-bash-nls.patch
 Patch5:                %{name}-sparc-softfp-gcc.patch
 Patch6:                %{name}-paths.patch
-
+Patch7:                %{name}-tzset-default.patch
 Patch8:                %{name}-missing-nls.patch
 Patch9:                %{name}-nss_include_dirs.patch
 Patch10:       %{name}-info.patch
@@ -958,7 +958,7 @@ exit 1
 %{!?with_bash_nls:%patch4 -p1}
 %patch5 -p1
 %patch6 -p1
-
+%patch7 -p1
 %patch8 -p1
 %patch9 -p1
 
This page took 0.075284 seconds and 4 git commands to generate.