SQLite

View Ticket
Login
Ticket Hash: 981329adeef51011052667a951108c01113d131c
Title: Stack overflow while parsing deeply nested JSON
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2017-04-11 18:55:12
Version Found In: 3.18.0
User Comments:
drh added on 2017-04-11 18:09:39: (text/x-fossil-wiki)
The following query causes a stack overflow in the JSON parser:

<blockquote><verbatim>
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<400000)
SELECT json_valid(group_concat('[', '')) FROM c;
</verbatim></blockquote>

This problem was reported on the SQLite mailing list by Ralf Junker and is
based on the n_structure_100000_opening_arrays.json test case from the
[https://github.com/nst/JSONTestSuite|JSONTestSuite].