The bogon will trigger the assertion in mpz_import_data:
src/expression.c:418: constant_expr_alloc: Assertion `(((len) + (8) - 1) / (8)) > 0' failed.
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
expr->flags = EXPR_F_CONSTANT | EXPR_F_SINGLETON;
mpz_init2(expr->value, len);
- if (data != NULL)
+ if (data != NULL && len)
mpz_import_data(expr->value, data, byteorder,
div_round_up(len, BITS_PER_BYTE));
--- /dev/null
+{
+ "nftables": [
+ {
+ "table": {
+ "family": "ip",
+ "name": "t",
+ "handle": 0
+ }
+ },
+ {
+ "chain": {
+ "family": "ip",
+ "table": "t",
+ "name": "testchain",
+ "handle": 0
+ }
+ },
+ {
+ "map": {
+ "family": "ip",
+ "name": "testmap",
+ "table": "t",
+ "type": "ipv4_addr",
+ "handle": 0,
+ "map": "verdict",
+ "elem": [
+ [
+ {
+ "jump": {
+ "target": ""
+ }
+ }
+ ]
+ ]
+ }
+ }
+ ]
+}