clean up the depth tracking a bit
This commit is contained in:
17
xmltest.cpp
17
xmltest.cpp
@@ -2026,12 +2026,19 @@ int main( int argc, const char ** argv )
|
||||
}
|
||||
|
||||
{
|
||||
// Bad bad crash.
|
||||
XMLDocument doc;
|
||||
doc.LoadFile("./resources/xmltest-5330.xml");
|
||||
XMLTest("Stack overflow prevented.", XMLError::XML_ELEMENT_DEPTH_EXCEEDED, doc.ErrorID());
|
||||
// Bad bad crash. Parsing error results in stack overflow, if uncaught.
|
||||
const char* TESTS[] = {
|
||||
"./resources/xmltest-5330.xml",
|
||||
"./resources/xmltest-4636783552757760.xml",
|
||||
"./resources/xmltest-5720541257269248.xml",
|
||||
0
|
||||
};
|
||||
for (int i=0; TESTS[i]; ++i) {
|
||||
XMLDocument doc;
|
||||
doc.LoadFile(TESTS[i]);
|
||||
XMLTest("Stack overflow prevented.", XMLError::XML_ELEMENT_DEPTH_EXCEEDED, doc.ErrorID());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Crashing reported via email.
|
||||
const char* xml =
|
||||
|
||||
Reference in New Issue
Block a user