mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +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);
|
||||
if (RAW != '"') {
|
||||
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
||||
xmlFree((xmlChar *) encoding);
|
||||
return(NULL);
|
||||
} else
|
||||
NEXT;
|
||||
} else if (RAW == '\''){
|
||||
@@ -10411,6 +10413,8 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
|
||||
encoding = xmlParseEncName(ctxt);
|
||||
if (RAW != '\'') {
|
||||
xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
|
||||
xmlFree((xmlChar *) encoding);
|
||||
return(NULL);
|
||||
} else
|
||||
NEXT;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user