1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

Robin Berjon <robin@knowscape.com> found a case where non-wellformed XML

* parser.c: Robin Berjon <robin@knowscape.com> found a case
  where non-wellformed XML declaractions were not detected.
Daniel
This commit is contained in:
Daniel Veillard 2001-11-29 16:11:38 +00:00
parent 913d6e090f
commit 1984094c15
2 changed files with 24 additions and 12 deletions

View File

@ -1,3 +1,8 @@
Thu Nov 29 17:10:22 CET 2001 Daniel Veillard <daniel@veillard.com>
* parser.c: Robin Berjon <robin@knowscape.com> found a case
where non-wellformed XML declaractions were not detected.
Wed Nov 28 15:41:40 CET 2001 Daniel Veillard <daniel@veillard.com>
* xpointer.c: fixed a compilation bug pointed by Danny Jamshy

View File

@ -7316,21 +7316,28 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
SKIP_BLANKS;
/*
* We should have the VersionInfo here.
* We must have the VersionInfo here.
*/
version = xmlParseVersionInfo(ctxt);
if (version == NULL)
version = xmlCharStrdup(XML_DEFAULT_VERSION);
else if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
/*
* TODO: Blueberry should be detected here
*/
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt->userData, "Unsupported version '%s'\n",
version);
if (version == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Malformed declaration expecting version\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
} else {
if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
/*
* TODO: Blueberry should be detected here
*/
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt->userData, "Unsupported version '%s'\n",
version);
}
if (ctxt->version != NULL)
xmlFree(ctxt->version);
ctxt->version = version;
}
ctxt->version = xmlStrdup(version);
xmlFree(version);
/*
* We may have the encoding declaration