mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
Jirka Kosek pointer out a bug in xmlParseTextDecl() when the version info
* parser.c: Jirka Kosek pointer out a bug in xmlParseTextDecl() when the version info is not present. Daniel
This commit is contained in:
16
parser.c
16
parser.c
@ -4961,18 +4961,20 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
|
||||
version = xmlParseVersionInfo(ctxt);
|
||||
if (version == NULL)
|
||||
version = xmlCharStrdup(XML_DEFAULT_VERSION);
|
||||
else {
|
||||
if (!IS_BLANK(CUR)) {
|
||||
ctxt->errNo = XML_ERR_SPACE_REQUIRED;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData, "Space needed here\n");
|
||||
ctxt->wellFormed = 0;
|
||||
ctxt->disableSAX = 1;
|
||||
}
|
||||
}
|
||||
ctxt->input->version = version;
|
||||
|
||||
/*
|
||||
* We must have the encoding declaration
|
||||
*/
|
||||
if (!IS_BLANK(CUR)) {
|
||||
ctxt->errNo = XML_ERR_SPACE_REQUIRED;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||
ctxt->sax->error(ctxt->userData, "Space needed here\n");
|
||||
ctxt->wellFormed = 0;
|
||||
ctxt->disableSAX = 1;
|
||||
}
|
||||
xmlParseEncodingDecl(ctxt);
|
||||
if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user