Test for CVE-2018-20573
This commit is contained in:
parent
452675f701
commit
1d1fdfeb13
@ -27,3 +27,14 @@ TEST(ParserTest, CVE_2017_5950) {
|
||||
NiceMock<MockEventHandler> handler;
|
||||
EXPECT_THROW(parser.HandleNextDocument(handler), YAML::ParserException);
|
||||
}
|
||||
|
||||
TEST(ParserTest, CVE_2018_20573) {
|
||||
std::string excessive_recursion;
|
||||
for (auto i = 0; i != 20535; ++i)
|
||||
excessive_recursion.push_back('{');
|
||||
std::istringstream input{excessive_recursion};
|
||||
Parser parser{input};
|
||||
|
||||
NiceMock<MockEventHandler> handler;
|
||||
EXPECT_THROW(parser.HandleNextDocument(handler), YAML::ParserException);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user