mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 12:25:09 +03:00
fuzz: Don't check for malloc failures when serializing
DTD serialization doesn't report malloc failures yet.
This commit is contained in:
parent
6aae176798
commit
84e50a0c48
15
fuzz/xml.c
15
fuzz/xml.c
@ -70,12 +70,25 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
|
||||
buffer = xmlBufferCreate();
|
||||
save = xmlSaveToBuffer(buffer, NULL, 0);
|
||||
if (save != NULL) {
|
||||
#if 0
|
||||
int errNo;
|
||||
|
||||
/*
|
||||
* DTD serialization doesn't report malloc failures:
|
||||
*
|
||||
* - xmlBufDumpNotationTable
|
||||
* - xmlBufDumpElementDecl
|
||||
* - xmlBufDumpAttributeDecl
|
||||
* - xmlBufDumpEntityDecl
|
||||
*/
|
||||
xmlSaveDoc(save, doc);
|
||||
errNo = xmlSaveFinish(save);
|
||||
xmlFuzzCheckMallocFailure("xmlDocDumpMemory",
|
||||
xmlFuzzCheckMallocFailure("xmlSaveDoc",
|
||||
errNo == XML_ERR_NO_MEMORY);
|
||||
#else
|
||||
xmlSaveDoc(save, doc);
|
||||
xmlSaveFinish(save);
|
||||
#endif
|
||||
}
|
||||
xmlBufferFree(buffer);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user