Skip to content
  • Knut Anders Hatlen's avatar
    2eb6e61a
    Bug#21377136: STACK OVERFLOW IN RAPIDJSON::GENERICREADER · 2eb6e61a
    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)
    2eb6e61a
    Bug#21377136: STACK OVERFLOW IN RAPIDJSON::GENERICREADER
    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)
Loading