mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-04-24 18:50:07 +03:00
malloc-fail: Fix null deref in xmlAddDefAttrs
Found with libFuzzer, see #344.
This commit is contained in:
parent
2355eac59e
commit
bd9de3a31f
2
parser.c
2
parser.c
@ -1274,6 +1274,8 @@ xmlAddDefAttrs(xmlParserCtxtPtr ctxt,
|
|||||||
/* intern the string and precompute the end */
|
/* intern the string and precompute the end */
|
||||||
len = xmlStrlen(value);
|
len = xmlStrlen(value);
|
||||||
value = xmlDictLookup(ctxt->dict, value, len);
|
value = xmlDictLookup(ctxt->dict, value, len);
|
||||||
|
if (value == NULL)
|
||||||
|
goto mem_error;
|
||||||
defaults->values[5 * defaults->nbAttrs + 2] = value;
|
defaults->values[5 * defaults->nbAttrs + 2] = value;
|
||||||
defaults->values[5 * defaults->nbAttrs + 3] = value + len;
|
defaults->values[5 * defaults->nbAttrs + 3] = value + len;
|
||||||
if (ctxt->external)
|
if (ctxt->external)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user