]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_json: Fix flowtable prio value parsing
authorPhil Sutter <phil@nwl.cc>
Wed, 20 Sep 2023 17:33:40 +0000 (19:33 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Nov 2023 11:23:37 +0000 (12:23 +0100)
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>
src/parser_json.c

index 996004acc2d6b3ac499e314edb7b3dea88041d15..29d7b2c6e09dfee1a1d786cb0040ef4e821bf0bb 100644 (file)
@@ -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);