rustyrussell / ccan

The C Code Archive Network
http://ccodearchive.net/
1.11k stars 206 forks source link

Add and fix JSON stack overflow tests #74

Open lod opened 6 years ago

lod commented 6 years ago

Fixes #73

The JSON test suite (https://github.com/nst/JSONTestSuite/) contains a list of JSON test files, two of which which triggered crashes. n_structure_100000_opening_arrays.json n_structure_open_array_object.json

These crashes were both caused by excessive recursion as they created massively deep arrays and objects.

These test examples have been added to test-strings. Modifications were alse made to the test runners to support them.

An arbitrary depth cap has been added to the parser prevent the overflow problem.

lod commented 6 years ago

Clang tests failing, looks like this error https://github.com/travis-ci/travis-ci/issues/8613