fuzz/xml_parsebuffer_fuzzer.c: Be more robust towards ouf-of-memory

This commit is contained in:
Sebastian Pipping 2024-01-16 23:14:39 +01:00 committed by Philippe Antoine
parent 34af886238
commit 5b70d3ac44

View file

@ -71,7 +71,9 @@ ParseOneInput(XML_Parser p, const uint8_t *data, size_t size) {
memcpy(buf, data, size);
XML_ParseBuffer(p, size, 0);
buf = XML_GetBuffer(p, size);
assert(buf);
if (buf == NULL) {
return;
}
memcpy(buf, data, size);
if (XML_ParseBuffer(p, size, 1) == XML_STATUS_ERROR) {
XML_ErrorString(XML_GetErrorCode(p));