You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

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