Message ID | 20171011182144.08ffc990@xeon-e3 |
---|---|
State | RFC, archived |
Delegated to: | stephen hemminger |
Headers | show |
Series | [RFC] iproute2: reject zero length strings for matches | expand |
diff --git a/lib/utils.c b/lib/utils.c index ac155bf5a044..b68a2e0f4a07 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -733,7 +733,7 @@ int matches(const char *cmd, const char *pattern) { int len = strlen(cmd); - if (len > strlen(pattern)) + if (len == 0 || len > strlen(pattern)) return -1; return memcmp(pattern, cmd, len); }