LibXML: Fail gracefully on integer overflow in character references

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47738
This commit is contained in:
Idan Horowitz 2022-07-10 19:48:02 +03:00
commit 18d25124bf
Notes: sideshowbarker 2024-07-17 09:31:44 +09:00
2 changed files with 14 additions and 5 deletions

View file

@ -20,3 +20,12 @@ TEST_CASE(char_data_ending)
return Test::Crash::Failure::DidNotCrash;
});
}
TEST_CASE(character_reference_integer_overflow)
{
EXPECT_NO_CRASH("parsing character references that do not fit in 32 bits should not crash", [] {
XML::Parser parser("<G>&#6666666666");
(void)parser.parse();
return Test::Crash::Failure::DidNotCrash;
});
}