netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH 1/3] meta: Reject zero ifindex values
@ 2019-07-18  3:39 Phil Sutter
  2019-07-18  3:39 ` [nft PATCH 2/3] meta: Reject nfproto value 0xffff Phil Sutter
  2019-07-18  3:39 ` [nft PATCH 3/3] tests/py: Add missing meta tests Phil Sutter
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Sutter @ 2019-07-18  3:39 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-18  3:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18  3:39 [nft PATCH 1/3] meta: Reject zero ifindex values Phil Sutter
2019-07-18  3:39 ` [nft PATCH 2/3] meta: Reject nfproto value 0xffff Phil Sutter
2019-07-18  3:39 ` [nft PATCH 3/3] tests/py: Add missing meta tests Phil Sutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).