Files
splinter/vendor
lotherk e7e47b7f1d json: a depth limit, so a nested body cannot kill the process
The parser recurses once per container and had no limit. The OpenAI gateway and
the A2A server hand it a caller's body of up to 4 MiB, so a request of 200k
nested arrays was a remote crash: verified against a running gateway, the
process died and the client got an empty reply. 200k arrays are a 400 KB body,
well inside what both servers accept.

J_MAX_DEPTH = 64 is far past any real document (a tool schema nests four or
five deep) and far short of a stack frame budget. A deeper document is now a
parse error, which both servers already answer with 400.

Proof in tests/test_fuzz.c (test_json_depth): 200k nested arrays crash without
the limit and parse as NULL with it; an ordinary document still parses.

make check: all tests passed. make check-asan: all 45 test binaries clean.
2026-11-23 00:56:58 +00:00
..