Blame SOURCES/libxt_time-Drop-initialization-of-variable-year.patch

9a3fa7
From c6d6426921160fb554871fbe201722963f8a917c Mon Sep 17 00:00:00 2001
9a3fa7
From: Phil Sutter <psutter@redhat.com>
9a3fa7
Date: Fri, 15 Mar 2019 17:50:10 +0100
9a3fa7
Subject: [PATCH] libxt_time: Drop initialization of variable 'year'
9a3fa7
9a3fa7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1525980
9a3fa7
Upstream Status: iptables commit 6b7145fa2112e
9a3fa7
9a3fa7
commit 6b7145fa2112e257073cc44346e9891fa23ce9c2
9a3fa7
Author: Phil Sutter <phil@nwl.cc>
9a3fa7
Date:   Wed Sep 19 15:16:52 2018 +0200
9a3fa7
9a3fa7
    libxt_time: Drop initialization of variable 'year'
9a3fa7
9a3fa7
    The variable is not read before being assigned the return value of
9a3fa7
    strtoul(), thefore the initialization is useless. And since after this
9a3fa7
    change parameter 'end' becomes unused, drop it as well.
9a3fa7
9a3fa7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
9a3fa7
    Signed-off-by: Florian Westphal <fw@strlen.de>
9a3fa7
9a3fa7
Signed-off-by: Phil Sutter <psutter@redhat.com>
9a3fa7
---
9a3fa7
 extensions/libxt_time.c | 8 ++++----
9a3fa7
 1 file changed, 4 insertions(+), 4 deletions(-)
9a3fa7
9a3fa7
diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c
9a3fa7
index 9c5bda88c1c78..5a8cc5de13031 100644
9a3fa7
--- a/extensions/libxt_time.c
9a3fa7
+++ b/extensions/libxt_time.c
9a3fa7
@@ -88,10 +88,10 @@ static void time_init(struct xt_entry_match *m)
9a3fa7
 	info->date_stop  = INT_MAX;
9a3fa7
 }
9a3fa7
 
9a3fa7
-static time_t time_parse_date(const char *s, bool end)
9a3fa7
+static time_t time_parse_date(const char *s)
9a3fa7
 {
9a3fa7
 	unsigned int month = 1, day = 1, hour = 0, minute = 0, second = 0;
9a3fa7
-	unsigned int year  = end ? 2038 : 1970;
9a3fa7
+	unsigned int year;
9a3fa7
 	const char *os = s;
9a3fa7
 	struct tm tm;
9a3fa7
 	time_t ret;
9a3fa7
@@ -265,10 +265,10 @@ static void time_parse(struct xt_option_call *cb)
9a3fa7
 	xtables_option_parse(cb);
9a3fa7
 	switch (cb->entry->id) {
9a3fa7
 	case O_DATE_START:
9a3fa7
-		info->date_start = time_parse_date(cb->arg, false);
9a3fa7
+		info->date_start = time_parse_date(cb->arg);
9a3fa7
 		break;
9a3fa7
 	case O_DATE_STOP:
9a3fa7
-		info->date_stop = time_parse_date(cb->arg, true);
9a3fa7
+		info->date_stop = time_parse_date(cb->arg);
9a3fa7
 		break;
9a3fa7
 	case O_TIME_START:
9a3fa7
 		info->daytime_start = time_parse_minutes(cb->arg);
9a3fa7
-- 
9a3fa7
2.21.0
9a3fa7