mirror of https://github.com/google/oss-fuzz.git
[libxml2] Disable XML_PARSE_HUGE to avoid stack overflow.
Mirror the change from Chromium version: https://chromium-review.googlesource.com/c/chromium/src/+/720537 This should fix the following bugs: - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2336 - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2731 - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2779 - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3245
This commit is contained in:
parent
fffae2ee8f
commit
30797e783a
|
@ -25,6 +25,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
const std::size_t data_hash = std::hash<std::string>()(data_string);
|
||||
const int max_option_value = std::numeric_limits<int>::max();
|
||||
const int random_option_value = data_hash % max_option_value;
|
||||
|
||||
// Disable XML_PARSE_HUGE to avoid stack overflow.
|
||||
random_option_value &= ~XML_PARSE_HUGE;
|
||||
const int options[] = {0, random_option_value};
|
||||
|
||||
for (const auto option_value : options) {
|
||||
|
|
Loading…
Reference in New Issue