| 139 | |
| 140 | |
| 141 | void ParserImpl::handleArray() |
| 142 | { |
| 143 | // Enforce the configured depth limit (set via setDepth) to avoid a native-stack |
| 144 | // overflow on deeply nested input. _depth == JSON_UNLIMITED_DEPTH (-1) means no limit. |
| 145 | if (_depth != JSON_UNLIMITED_DEPTH && _currentDepth >= _depth) |
| 146 | throw JSONException("Maximum allowed JSON depth exceeded"); |
| 147 | ++_currentDepth; |
| 148 | |
| 149 | json_type tok = json_peek(_pJSON); |
| 150 | while (tok != JSON_ARRAY_END && checkError()) |
| 151 | { |
| 152 | handle(); |
| 153 | tok = json_peek(_pJSON); |
| 154 | } |
| 155 | |
| 156 | if (tok == JSON_ARRAY_END) handle(); |
| 157 | else throw JSONException("JSON array end not found"); |
| 158 | |
| 159 | --_currentDepth; |
| 160 | } |
| 161 | |
| 162 | |
| 163 | void ParserImpl::handleObject() |
nothing calls this directly
no test coverage detected