mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-21 22:50:08 +03:00
Stop parser on unsupported encodings
Otherwise, the push parser can loop infinitely in recover mode. Found with libFuzzer.
This commit is contained in:
parent
030b1f7a27
commit
0db8dc9ddc
@ -1101,8 +1101,10 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (handler == NULL)
|
||||
if (handler == NULL) {
|
||||
xmlStopParser(ctxt);
|
||||
return(-1);
|
||||
}
|
||||
ctxt->charset = XML_CHAR_ENCODING_UTF8;
|
||||
ret = xmlSwitchToEncodingInt(ctxt, handler, len);
|
||||
if ((ret < 0) || (ctxt->errNo == XML_I18N_CONV_FAILED)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user