File 0004-zoneinfo-remove-untrue-assumptions.patch of Package syslog-ng.12645

From dd65e09030992558090c8df992bbdc51d7029242 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= <laszlo.varady@balabit.com>
Date: Sat, 31 Aug 2019 00:35:30 +0200
Subject: [PATCH 4/4] zoneinfo: remove untrue assumptions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Based on tzcode 2019b.

Signed-off-by: László Várady <laszlo.varady@balabit.com>
(cherry picked from commit 024dab91300f653da829cd7d83c361c2707c5cc6)
---
 lib/timeutils.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/lib/timeutils.c b/lib/timeutils.c
index d8ce3ae3f..2a66bf7f5 100644
--- a/lib/timeutils.c
+++ b/lib/timeutils.c
@@ -606,19 +606,6 @@ zone_info_parser(unsigned char **input, gboolean is64bitData, gint *version)
   typecnt  = readcoded32(input, 0, G_MAXINT64);
   charcnt  = readcoded32(input, 0, G_MAXINT64);
 
-  /*
-   * Confirm sizes that we assume to be equal.  These assumptions
-   * are drawn from a reading of the zic source (2003a), so they
-   * should hold unless the zic source changes.
-   */
-
-  if (isutcnt != typecnt ||
-      isstdcnt != typecnt)
-    {
-      msg_warning("Error in the time zone file",
-                  evt_tag_str("message", "Count mismatch between tzh_ttisutcnt, tzh_ttisstdcnt, tzh_typecnt"));
-    }
-
   /*
    * Used temporarily to store transition times and types.  We need
    * to do this because the times and types are stored in two
@@ -779,11 +766,11 @@ zone_info_parser(unsigned char **input, gboolean is64bitData, gint *version)
   /* We dont nead this flags to compute the wall time of the timezone*/
 
   /* Ignore isstd flags */
-  for (i=0; i<typecnt; i++)
+  for (i=0; i<isstdcnt; i++)
     readbool(input);
 
   /* Ignore isut flags */
-  for (i=0; i<typecnt; i++)
+  for (i=0; i<isutcnt; i++)
     readbool(input);
 
 error:
-- 
2.16.4

openSUSE Build Service is sponsored by