forked from pool/libxml2
- Version update to 2.9.10:
* Portability:
+ Fix exponent digits when running tests under old MSVC
+ Work around buggy ceil() function on AIX
+ Don't call printf with NULL string in runtest.c
+ Switched from unsigned long to ptrdiff_t in parser.c
+ timsort.h: support older GCCs
+ Make configure.ac work with older pkg-config
* Bug Fixes:
+ Fix for conditional sections at end of document
+ Make sure that Python tests exit with error code
+ Audit memory error handling in xpath.c
+ Fix error code in xmlTextWriterStartDocument
+ Fix integer overflow when counting written bytes
+ Fix uninitialized memory access in HTML parser
+ Fix memory leak in xmlSchemaValAtomicType
+ Disallow conditional sections in internal subset
+ Fix use-after-free in xmlTextReaderFreeNodeList
+ Fix Regextests
+ Fix empty branch in regex
+ Fix integer overflow in entity recursion check
+ Don't read external entities or XIncludes from stdin
+ Fix Schema determinism check of ##other namespaces
+ Fix potential null deref in xmlSchemaIDCFillNodeTables
+ Fix potential memory leak in xmlBufBackToBuffer
+ Fix error message when processing XIncludes with fallbacks
+ Fix memory leak in xmlRegEpxFromParse
+ 14:00 is a valid timezone for xs:dateTime
+ Fix memory leak in xmlParseBalancedChunkMemoryRecover
+ Fix potential null deref in xmlRelaxNGParsePatterns
OBS-URL: https://build.opensuse.org/request/show/748960
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libxml2?expand=0&rev=139
134 lines
4.0 KiB
Diff
134 lines
4.0 KiB
Diff
commit 77b77b1301e052d90e6a0967534a698506afcd86
|
|
Author: Daniel Veillard <veillard@redhat.com>
|
|
Date: Thu Jan 26 19:11:02 2012 +0800
|
|
|
|
Fix SAX2 builder in case of undefined element namespaces
|
|
|
|
Work as in XML-1.0 before namespaces, and use prefix:localname
|
|
as the new element name (and no namespace of course)
|
|
Also fix 3 cases in the regression tests where the prefix: was
|
|
erroneously dropped in such case
|
|
|
|
Index: SAX2.c
|
|
===================================================================
|
|
--- SAX2.c.orig
|
|
+++ SAX2.c
|
|
@@ -2222,7 +2222,6 @@ xmlSAX2StartElementNs(void *ctx,
|
|
xmlNodePtr parent;
|
|
xmlNsPtr last = NULL, ns;
|
|
const xmlChar *uri, *pref;
|
|
- xmlChar *lname = NULL;
|
|
int i, j;
|
|
|
|
if (ctx == NULL) return;
|
|
@@ -2242,20 +2241,6 @@ xmlSAX2StartElementNs(void *ctx,
|
|
}
|
|
|
|
/*
|
|
- * Take care of the rare case of an undefined namespace prefix
|
|
- */
|
|
- if ((prefix != NULL) && (URI == NULL)) {
|
|
- if (ctxt->dictNames) {
|
|
- const xmlChar *fullname;
|
|
-
|
|
- fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
|
|
- if (fullname != NULL)
|
|
- localname = fullname;
|
|
- } else {
|
|
- lname = xmlBuildQName(localname, prefix, NULL, 0);
|
|
- }
|
|
- }
|
|
- /*
|
|
* allocate the node
|
|
*/
|
|
if (ctxt->freeElems != NULL) {
|
|
@@ -2269,10 +2254,7 @@ xmlSAX2StartElementNs(void *ctx,
|
|
if (ctxt->dictNames)
|
|
ret->name = localname;
|
|
else {
|
|
- if (lname == NULL)
|
|
- ret->name = xmlStrdup(localname);
|
|
- else
|
|
- ret->name = lname;
|
|
+ ret->name = xmlStrdup(localname);
|
|
if (ret->name == NULL) {
|
|
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
|
|
return;
|
|
@@ -2284,11 +2266,8 @@ xmlSAX2StartElementNs(void *ctx,
|
|
if (ctxt->dictNames)
|
|
ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
|
|
(xmlChar *) localname, NULL);
|
|
- else if (lname == NULL)
|
|
- ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
|
|
else
|
|
- ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
|
|
- (xmlChar *) lname, NULL);
|
|
+ ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
|
|
if (ret == NULL) {
|
|
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
|
|
return;
|
|
@@ -2399,31 +2378,6 @@ xmlSAX2StartElementNs(void *ctx,
|
|
*/
|
|
if (nb_attributes > 0) {
|
|
for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
|
|
- /*
|
|
- * Handle the rare case of an undefined attribute prefix
|
|
- */
|
|
- if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
|
|
- if (ctxt->dictNames) {
|
|
- const xmlChar *fullname;
|
|
-
|
|
- fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
|
|
- attributes[j]);
|
|
- if (fullname != NULL) {
|
|
- xmlSAX2AttributeNs(ctxt, fullname, NULL,
|
|
- attributes[j+3], attributes[j+4]);
|
|
- continue;
|
|
- }
|
|
- } else {
|
|
- lname = xmlBuildQName(attributes[j], attributes[j+1],
|
|
- NULL, 0);
|
|
- if (lname != NULL) {
|
|
- xmlSAX2AttributeNs(ctxt, lname, NULL,
|
|
- attributes[j+3], attributes[j+4]);
|
|
- xmlFree(lname);
|
|
- continue;
|
|
- }
|
|
- }
|
|
- }
|
|
xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
|
|
attributes[j+3], attributes[j+4]);
|
|
}
|
|
Index: result/namespaces/err_7.xml
|
|
===================================================================
|
|
--- result/namespaces/err_7.xml.orig
|
|
+++ result/namespaces/err_7.xml
|
|
@@ -1,2 +1,2 @@
|
|
<?xml version="1.0"?>
|
|
-<f:foo/>
|
|
+<foo/>
|
|
Index: result/xmlid/id_tst2.xml
|
|
===================================================================
|
|
--- result/xmlid/id_tst2.xml.orig
|
|
+++ result/xmlid/id_tst2.xml
|
|
@@ -1,6 +1,6 @@
|
|
Object is a Node Set :
|
|
Set contains 1 nodes:
|
|
-1 ELEMENT n:foo
|
|
+1 ELEMENT foo
|
|
ATTRIBUTE id
|
|
TEXT
|
|
content=bar
|
|
Index: result/xmlid/id_tst3.xml
|
|
===================================================================
|
|
--- result/xmlid/id_tst3.xml.orig
|
|
+++ result/xmlid/id_tst3.xml
|
|
@@ -1,6 +1,6 @@
|
|
Object is a Node Set :
|
|
Set contains 1 nodes:
|
|
-1 ELEMENT f:o:o
|
|
+1 ELEMENT o:o
|
|
ATTRIBUTE id
|
|
TEXT
|
|
content=bar
|