aboutsummaryrefslogtreecommitdiff
path: root/contrib/expat/fuzz/xml_lpm_fuzzer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/expat/fuzz/xml_lpm_fuzzer.cpp')
-rw-r--r--contrib/expat/fuzz/xml_lpm_fuzzer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/expat/fuzz/xml_lpm_fuzzer.cpp b/contrib/expat/fuzz/xml_lpm_fuzzer.cpp
index f52ea7b21e40..719629a6b547 100644
--- a/contrib/expat/fuzz/xml_lpm_fuzzer.cpp
+++ b/contrib/expat/fuzz/xml_lpm_fuzzer.cpp
@@ -354,8 +354,10 @@ ExternalEntityRefHandler(XML_Parser parser, const XML_Char *context,
if (g_external_entity) {
XML_Parser ext_parser
= XML_ExternalEntityParserCreate(parser, context, g_encoding);
- rc = Parse(ext_parser, g_external_entity, g_external_entity_size, 1);
- XML_ParserFree(ext_parser);
+ if (ext_parser != NULL) {
+ rc = Parse(ext_parser, g_external_entity, g_external_entity_size, 1);
+ XML_ParserFree(ext_parser);
+ }
}
return rc;