mirror of
https://github.com/nlohmann/json.git
synced 2026-02-09 11:42:51 +00:00
Add unit test for parsing deeply-nested array
This commit is contained in:
@@ -1708,6 +1708,16 @@ TEST_CASE("regression tests")
|
||||
const auto data = j.get<decltype(expected)>();
|
||||
CHECK(expected == data);
|
||||
}
|
||||
|
||||
SECTION("issue #1419 - Segmentation fault (stack overflow) due to unbounded recursion")
|
||||
{
|
||||
const int depth = 8000000;
|
||||
|
||||
std::string s(depth, '[');
|
||||
s += std::string(depth, ']');
|
||||
|
||||
CHECK_NOTHROW(nlohmann::json::parse(s));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("regression tests, exceptions dependent", "[!throws]")
|
||||
|
||||
Reference in New Issue
Block a user