1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-13 20:58:16 +03:00

malloc-fail: Fix null deref in xmlSchemaValAtomicType

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-05 14:08:15 +01:00
parent 112340c6c0
commit 7762e8eda1

View File

@ -3040,6 +3040,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
value = norm;
}
tmpval = xmlStrdup(value);
if (tmpval == NULL)
goto error;
for (cur = tmpval; *cur; ++cur) {
if (*cur < 32 || *cur >= 127 || *cur == ' ' ||
*cur == '<' || *cur == '>' || *cur == '"' ||