Home GnuPG
Diffusion GPGME 4a117859e7a5

json: Limit recursion depth

Description

json: Limit recursion depth

* src/cJSON.c (MAX_DEPTH): New. Maximum recursion depth.
(parse_value, parse_array, parse_object): Carry and check
depth argument.
(cJSON_ParseWithOpts): Initialize depth.

This fixes a stack overflow if we get weird recursive
json data.