mirror of
https://github.com/json-c/json-c.git
synced 2026-04-03 04:19:07 +08:00
Issue #881: don't allow json_tokener_new_ex() with a depth < 1
This commit is contained in:
@@ -154,6 +154,9 @@ struct json_tokener *json_tokener_new_ex(int depth)
|
||||
{
|
||||
struct json_tokener *tok;
|
||||
|
||||
if (depth < 1)
|
||||
return NULL;
|
||||
|
||||
tok = (struct json_tokener *)calloc(1, sizeof(struct json_tokener));
|
||||
if (!tok)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user