Blame SOURCES/0103-tc-tc_filter-Make-sure-filter-name-is-not-empty.patch

99be8f
From a4c190565a85db814ad1185ada5382e7fb8707a0 Mon Sep 17 00:00:00 2001
99be8f
From: Andrea Claudi <aclaudi@redhat.com>
99be8f
Date: Mon, 29 Apr 2019 20:08:08 +0200
99be8f
Subject: [PATCH] tc/tc_filter: Make sure filter name is not empty
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
99be8f
Upstream Status: iproute2.git commit 75716932a0af2
99be8f
99be8f
commit 75716932a0af28da207aa57c212794ab28ce9036
99be8f
Author: Phil Sutter <phil@nwl.cc>
99be8f
Date:   Thu Aug 24 11:46:33 2017 +0200
99be8f
99be8f
    tc/tc_filter: Make sure filter name is not empty
99be8f
99be8f
    The later check for 'k[0] != 0' requires a non-empty filter name,
99be8f
    otherwise NULL pointer dereference in 'q' might happen.
99be8f
99be8f
    Signed-off-by: Phil Sutter <phil@nwl.cc>
99be8f
---
99be8f
 tc/tc_filter.c | 3 +++
99be8f
 1 file changed, 3 insertions(+)
99be8f
99be8f
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
99be8f
index e640492b25ba6..a6bb73d12eaba 100644
99be8f
--- a/tc/tc_filter.c
99be8f
+++ b/tc/tc_filter.c
99be8f
@@ -380,6 +380,9 @@ static int tc_filter_get(int cmd, unsigned int flags, int argc, char **argv)
99be8f
 			usage();
99be8f
 			return 0;
99be8f
 		} else {
99be8f
+			if (!**argv)
99be8f
+				invarg("invalid filter name", *argv);
99be8f
+
99be8f
 			strncpy(k, *argv, sizeof(k)-1);
99be8f
 
99be8f
 			q = get_filter_kind(k);
99be8f
-- 
d30c09
2.21.0
99be8f