]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: work around fuzzer-induced assert crashes
authorFlorian Westphal <fw@strlen.de>
Mon, 31 Mar 2025 14:47:11 +0000 (16:47 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 Jul 2025 00:38:27 +0000 (02:38 +0200)
commit18591a8d7fb769041da57fefb7e335b7ac5a8afa
treed9bbef102ca96b9f2026d20f4bfb9438b1b58387
parent801a06aece44d4954df03bd0e61c3e2e9ee557e9
json: work around fuzzer-induced assert crashes

commit 18c24d89b9977ddc0900be64fe9e95e7ac1ce896 upstream.

fuzzer can cause assert failures due to json_pack() returning a NULL
value and therefore triggering the assert(out) in __json_pack macro.

All instances I saw are due to invalid UTF-8 strings, i.e., table/chain
names with non-text characters in them.

Work around this for now, replace the assert with a plaintext error
message and return NULL instead of abort().

Signed-off-by: Florian Westphal <fw@strlen.de>
src/json.c