mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
Do not process encoding values if the declaration if broken
For https://bugzilla.gnome.org/show_bug.cgi?id=751603 If the string is not properly terminated do not try to convert to the given encoding.
This commit is contained in:
4
parser.c
4
parser.c
@@ -10404,6 +10404,8 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
|
|||||||
encoding = xmlParseEncName(ctxt);
|
encoding = xmlParseEncName(ctxt);
|
||||||
if (RAW != '"') {
|
if (RAW != '"') {
|
||||||
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
||||||
|
xmlFree((xmlChar *) encoding);
|
||||||
|
return(NULL);
|
||||||
} else
|
} else
|
||||||
NEXT;
|
NEXT;
|
||||||
} else if (RAW == '\''){
|
} else if (RAW == '\''){
|
||||||
@@ -10411,6 +10413,8 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
|
|||||||
encoding = xmlParseEncName(ctxt);
|
encoding = xmlParseEncName(ctxt);
|
||||||
if (RAW != '\'') {
|
if (RAW != '\'') {
|
||||||
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
||||||
|
xmlFree((xmlChar *) encoding);
|
||||||
|
return(NULL);
|
||||||
} else
|
} else
|
||||||
NEXT;
|
NEXT;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user