Skip to contentSkip to conversation

parser_json: Disallow ct helper as type to map to

PATCH Applied Phil Sutter 2 participants 2 messages Apr 11, 2019 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 parser_json: Disallow ct helper as type to map to

When creating a map, users may either map dtype:dtype or dtype:object. In the second case, only counter, quota, limit and secmark is allowed by bison, but JSON parser wasn't as strict, allowing ct helper as well. Remove that to avoid undefined behaviour.

Fixes 586ad210368b7 ("libnftables: Implement JSON parser")
---
 src/parser_json.c | 1 -
 1 file changed, 1 deletion(-)
src/parser_json.c +0 -1
index 19d3ad4728130..53017935eba53 100644
@@ -2503,7 +2503,6 @@ static int string_to_nft_object(const char *str)
 	const char *obj_tbl[__NFT_OBJECT_MAX] = {
 		[NFT_OBJECT_COUNTER] = "counter",
 		[NFT_OBJECT_QUOTA] = "quota",
-		[NFT_OBJECT_CT_HELPER] = "ct helper",
 		[NFT_OBJECT_LIMIT] = "limit",
 		[NFT_OBJECT_SECMARK] = "secmark",
 	};
Signature · 1 line
2.21.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Phil Sutter

When creating a map, users may either map dtype:dtype or dtype:object. In the second case, only counter, quota, limit and secmark is allowed by bison, but JSON parser wasn't as strict, allowing ct helper as well. Remove that to avoid undefined behaviour.

Applied, thanks Phil.