lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <88d7da8d165406b5b633a1822064c9f315a23b51.1618350667.git.aclaudi@redhat.com>
Date:   Wed, 14 Apr 2021 00:50:20 +0200
From:   Andrea Claudi <aclaudi@...hat.com>
To:     netdev@...r.kernel.org
Cc:     stephen@...workplumber.org, dsahern@...il.com
Subject: [PATCH iproute2] q_cake: remove useless check on argv

In cake_parse_opt(), *argv is checked not to be null when parsing for
overhead and mpu parameters. However this is useless, since *argv
matches right before for "overhead" or "mpu".

Signed-off-by: Andrea Claudi <aclaudi@...hat.com>
---
 tc/q_cake.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tc/q_cake.c b/tc/q_cake.c
index 4ff6056a..4cfc1c00 100644
--- a/tc/q_cake.c
+++ b/tc/q_cake.c
@@ -299,8 +299,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
 			NEXT_ARG();
 			overhead = strtol(*argv, &p, 10);
-			if (!p || *p || !*argv ||
-			    overhead < -64 || overhead > 256) {
+			if (!p || *p || overhead < -64 || overhead > 256) {
 				fprintf(stderr,
 					"Illegal \"overhead\", valid range is -64 to 256\\n");
 				return -1;
@@ -312,7 +311,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 
 			NEXT_ARG();
 			mpu = strtol(*argv, &p, 10);
-			if (!p || *p || !*argv || mpu < 0 || mpu > 256) {
+			if (!p || *p || mpu < 0 || mpu > 256) {
 				fprintf(stderr,
 					"Illegal \"mpu\", valid range is 0 to 256\\n");
 				return -1;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ