-
Knut Anders Hatlen authored
The JSON parser used by Json_dom::parse() has a mechanism for stopping if the document is very deep, in order to avoid stack overflow. However, the JSON_VALID function doesn't use Json_dom::parse(), since it doesn't care about building a Json_dom structure for the document. Instead, it uses its own light-weight parser, which is quicker, but this parser does not stop if the document gets too deep, and it could run out of stack space. This patch adds checks for nesting level to the light-weight parser used by JSON_VALID, so that it too stops if the document is deeply nested. (cherry picked from commit 7adcf99ec665c32156a344fee920dd8f2bd5e728)
Knut Anders Hatlen authoredThe JSON parser used by Json_dom::parse() has a mechanism for stopping if the document is very deep, in order to avoid stack overflow. However, the JSON_VALID function doesn't use Json_dom::parse(), since it doesn't care about building a Json_dom structure for the document. Instead, it uses its own light-weight parser, which is quicker, but this parser does not stop if the document gets too deep, and it could run out of stack space. This patch adds checks for nesting level to the light-weight parser used by JSON_VALID, so that it too stops if the document is deeply nested. (cherry picked from commit 7adcf99ec665c32156a344fee920dd8f2bd5e728)
Loading