summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-09-13 20:53:41 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-03 12:23:37 +0100
commit7324e3f693e3be93f31ce18d5b0d809abf2a8981 (patch)
tree1a29b64b4ba59a60ffe6312198b8e289490773ca
parent02158881cbcd23ad1eec6e1af6b6e18ab3f68a54 (diff)
parser_json: Wrong check in json_parse_ct_timeout_policy()
commit 1e5ad2eeb38af0af2e06d4cba0ec4d84009855fa upstream. The conditional around json_unpack() was meant to accept a missing policy attribute. But the accidentally inverted check made the function either ignore a given policy or access uninitialized memory. Fixes: c82a26ebf7e9f ("json: Add ct timeout support") 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 aa15a7fc..efa1205a 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -3299,7 +3299,7 @@ static int json_parse_ct_timeout_policy(struct json_ctx *ctx,
json_t *tmp, *val;
const char *key;
- if (!json_unpack(root, "{s:o}", "policy", &tmp))
+ if (json_unpack(root, "{s:o}", "policy", &tmp))
return 0;
if (!json_is_object(tmp)) {