1
0
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:
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

@ -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) {
/*