summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-09-20 19:33:40 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-03 12:23:37 +0100
commit8db9eb7543e9e5ecd22be2397c1201f67d057040 (patch)
tree746ae37ee38f55b5813cb4c225235b189db94e9c
parent04109b455293d726fb565ac02e083fa41330e672 (diff)
parser_json: Fix flowtable prio value parsing
commit 407e947dfc53827bd27689f2de9ed7f14f1b092e upstream. Using format specifier 'I' requires a 64bit variable to write into. The temporary variable 'prio' is of type int, though. Fixes: 586ad210368b7 ("libnftables: Implement JSON parser") Signed-off-by: Phil Sutter <phil@nwl.cc>
-rw-r--r--src/parser_json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser_json.c b/src/parser_json.c
index 996004ac..29d7b2c6 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -3258,7 +3258,7 @@ static struct cmd *json_parse_cmd_add_flowtable(struct json_ctx *ctx,
if (op == CMD_DELETE || op == CMD_LIST)
return cmd_alloc(op, cmd_obj, &h, int_loc, NULL);
- if (json_unpack_err(ctx, root, "{s:s, s:I}",
+ if (json_unpack_err(ctx, root, "{s:s, s:i}",
"hook", &hook,
"prio", &prio)) {
handle_free(&h);