naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0088-ss-Skip-useless-check-in-parse_hostcond.patch

36cfb7
From 4b2f0a5a479f2714b8b44932ba961ba8cf07e18e Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 29 Apr 2019 20:07:22 +0200
36cfb7
Subject: [PATCH] ss: Skip useless check in parse_hostcond()
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
36cfb7
Upstream Status: iproute2.git commit 44448a90eab34
36cfb7
36cfb7
commit 44448a90eab34713af019356926828720c67a268
36cfb7
Author: Phil Sutter <phil@nwl.cc>
36cfb7
Date:   Thu Aug 17 19:09:29 2017 +0200
36cfb7
36cfb7
    ss: Skip useless check in parse_hostcond()
36cfb7
36cfb7
    The passed 'addr' parameter is dereferenced by caller before and in
36cfb7
    parse_hostcond() multiple times before this check, so assume it is
36cfb7
    always true.
36cfb7
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
---
36cfb7
 misc/ss.c | 2 +-
36cfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/misc/ss.c b/misc/ss.c
36cfb7
index c97f05a4c7033..38f4017e4a8c8 100644
36cfb7
--- a/misc/ss.c
36cfb7
+++ b/misc/ss.c
36cfb7
@@ -1747,7 +1747,7 @@ void *parse_hostcond(char *addr, bool is_port)
36cfb7
 			}
36cfb7
 		}
36cfb7
 	}
36cfb7
-	if (!is_port && addr && *addr && *addr != '*') {
36cfb7
+	if (!is_port && *addr && *addr != '*') {
36cfb7
 		if (get_prefix_1(&a.addr, addr, fam)) {
36cfb7
 			if (get_dns_host(&a, addr, fam)) {
36cfb7
 				fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", addr);
36cfb7
-- 
e138d9
2.21.0
36cfb7