tc/tc_filter: Make sure filter name is not empty
The later check for 'k[0] != 0' requires a non-empty filter name, otherwise NULL pointer dereference in 'q' might happen. Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
a754de3ccd
commit
75716932a0
|
|
@ -412,6 +412,9 @@ static int tc_filter_get(int cmd, unsigned int flags, int argc, char **argv)
|
||||||
usage();
|
usage();
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
if (!**argv)
|
||||||
|
invarg("invalid filter name", *argv);
|
||||||
|
|
||||||
strncpy(k, *argv, sizeof(k)-1);
|
strncpy(k, *argv, sizeof(k)-1);
|
||||||
|
|
||||||
q = get_filter_kind(k);
|
q = get_filter_kind(k);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue