[packages/glibc] - added tzset-default patch (fixes python-dateutil test failures) - release 12

qboosh qboosh at pld-linux.org
Sat Jul 14 22:32:19 CEST 2018


commit da122e9b4612336338faad1d226d2a9817c61cfc
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Jul 14 22:34:02 2018 +0200

    - added tzset-default patch (fixes python-dateutil test failures)
    - release 12

 glibc-tzset-default.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++++
 glibc.spec                |  6 +++---
 2 files changed, 52 insertions(+), 3 deletions(-)
---
diff --git a/glibc.spec b/glibc.spec
index ce22eee..58d6130 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -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
 
diff --git a/glibc-tzset-default.patch b/glibc-tzset-default.patch
new file mode 100644
index 0000000..e17d983
--- /dev/null
+++ b/glibc-tzset-default.patch
@@ -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.  */
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list