[nft,1/3] meta: Reject zero ifindex values
diff mbox series

Message ID 20190718033940.12820-1-phil@nwl.cc
State Not Applicable
Delegated to: Pablo Neira
Headers show
Series
  • [nft,1/3] meta: Reject zero ifindex values
Related show

Commit Message

Phil Sutter July 18, 2019, 3:39 a.m. UTC
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/meta.c b/src/meta.c
index 1e8964eb48c4d..b12340991f35a 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -155,7 +155,7 @@  static struct error_record *ifindex_type_parse(const struct expr *sym,
 		errno = 0;
 		res = strtol(sym->identifier, &end, 10);
 
-		if (res < 0 || res > INT_MAX || *end || errno)
+		if (res <= 0 || res > INT_MAX || *end || errno)
 			return error(&sym->location, "Interface does not exist");
 
 		ifindex = (int)res;