json: Error out for objects and arrays that are nested too deep

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
Arun Raghavan 2016-06-01 17:18:36 +05:30
parent 5b1bd84902
commit 0c1dbf5c79
2 changed files with 19 additions and 10 deletions

View file

@ -227,6 +227,8 @@ START_TEST(bad_test) {
"1." /* Bad number string */,
"1.e3" /* Bad number string */,
"-" /* Bad number string */,
"{ \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { \"a\": { } } } } } } } } } } } } } } } } } } } } } }" /* Nested too deep */,
"[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ { \"a\": \"b\" } ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]" /* Nested too deep */,
};
for (i = 0; i < PA_ELEMENTSOF(bad_parse); i++) {