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