1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-21 22:50:08 +03:00

Fix null deref introduced with previous commit

Found by OSS-Fuzz.
This commit is contained in:
Nick Wellnhofer 2021-02-09 17:07:21 +01:00
parent 01411e7c5e
commit cbe1212db6

View File

@ -228,7 +228,8 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
int valid = 0;
/* 4.6 Predefined Entities */
if (type == XML_INTERNAL_GENERAL_ENTITY) {
if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
(content != NULL)) {
int c = predef->content[0];
if (((content[0] == c) && (content[1] == 0)) &&