1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-07 06:43:02 +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:
Daniel Veillard
2002-01-07 16:54:10 +00:00
parent 6f42c13647
commit 401c2114b4
2 changed files with 14 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
Mon Jan 7 17:52:48 CET 2002 Daniel Veillard <daniel@veillard.com>
* parser.c: Jirka Kosek pointer out a bug in xmlParseTextDecl()
when the version info is not present.
Mon Jan 7 00:03:58 CET 2002 Daniel Veillard <daniel@veillard.com> Mon Jan 7 00:03:58 CET 2002 Daniel Veillard <daniel@veillard.com>
* tree.c: Anthony Jones pointed out a problem in * tree.c: Anthony Jones pointed out a problem in

View File

@@ -4961,18 +4961,20 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
version = xmlParseVersionInfo(ctxt); version = xmlParseVersionInfo(ctxt);
if (version == NULL) if (version == NULL)
version = xmlCharStrdup(XML_DEFAULT_VERSION); 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; ctxt->input->version = version;
/* /*
* We must have the encoding declaration * 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); xmlParseEncodingDecl(ctxt);
if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) { if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
/* /*