]> 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)
committerPhil Sutter <phil@nwl.cc>
Fri, 22 Sep 2023 08:55:25 +0000 (10:55 +0200)
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 b41ddf2e12b27aa52337eebeb61f0da133ebf8d2..57c2c2a9bc432a75dfa609822332e35df53d3259 100644 (file)
@@ -3374,7 +3374,7 @@ static struct cmd *json_parse_cmd_add_flowtable(struct json_ctx *ctx,
        if (op == CMD_DELETE || op == CMD_LIST || op == CMD_DESTROY)
                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);