libxml2 r3680 - in trunk: . doc doc/devhelp result/errors test/errors



Author: veillard
Date: Thu Jan 24 14:48:54 2008
New Revision: 3680
URL: http://svn.gnome.org/viewvc/libxml2?rev=3680&view=rev

Log:
* parser.c: fix a memeory leak in internal subset parsing with
  a fix from Ashwin
* test/errors/content1.xml result/errors/content1.xml*:
  add test to regressions
Daniel


Added:
   trunk/result/errors/content1.xml
   trunk/result/errors/content1.xml.err
   trunk/result/errors/content1.xml.str
   trunk/test/errors/content1.xml
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/doc/devhelp/libxml2-valid.html
   trunk/doc/libxml2-api.xml
   trunk/parser.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Jan 24 14:48:54 2008
@@ -5,7 +5,7 @@
 
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=30
+LIBXML_MICRO_VERSION=31
 LIBXML_MICRO_VERSION_SUFFIX=
 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION

Modified: trunk/doc/devhelp/libxml2-valid.html
==============================================================================
--- trunk/doc/devhelp/libxml2-valid.html	(original)
+++ trunk/doc/devhelp/libxml2-valid.html	Thu Jan 24 14:48:54 2008
@@ -101,6 +101,7 @@
 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	<a href="#xmlCopyDocElementContent">xmlCopyDocElementContent</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>							 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> cur);
 <a href="libxml2-tree.html#xmlIDPtr">xmlIDPtr</a>	<a href="#xmlAddID">xmlAddID</a>		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br/>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr);
 void	<a href="#xmlFreeRefTable">xmlFreeRefTable</a>			(<a href="libxml2-valid.html#xmlRefTablePtr">xmlRefTablePtr</a> table);
+int	<a href="#xmlValidateNamesValue">xmlValidateNamesValue</a>		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
 int	<a href="#xmlRemoveID">xmlRemoveID</a>			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr);
 void	<a href="#xmlFreeElementTable">xmlFreeElementTable</a>		(<a href="libxml2-valid.html#xmlElementTablePtr">xmlElementTablePtr</a> table);
 void	<a href="#xmlFreeIDTable">xmlFreeIDTable</a>			(<a href="libxml2-valid.html#xmlIDTablePtr">xmlIDTablePtr</a> table);
@@ -112,7 +113,6 @@
 typedef void <a href="#xmlValidityWarningFunc">xmlValidityWarningFunc</a>		(void * ctx, <br/>					 const char * msg, <br/>					 ... ...);
 int	<a href="#xmlValidatePopElement">xmlValidatePopElement</a>		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * qname);
 void	<a href="#xmlFreeEnumeration">xmlFreeEnumeration</a>		(<a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> cur);
-int	<a href="#xmlValidateNamesValue">xmlValidateNamesValue</a>		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
 <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	<a href="#xmlCopyEnumeration">xmlCopyEnumeration</a>	(<a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> cur);
 <a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	<a href="#xmlGetDtdAttrDesc">xmlGetDtdAttrDesc</a>	(<a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br/>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 int	<a href="#xmlValidateDtd">xmlValidateDtd</a>			(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br/>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd);

Modified: trunk/doc/libxml2-api.xml
==============================================================================
--- trunk/doc/libxml2-api.xml	(original)
+++ trunk/doc/libxml2-api.xml	Thu Jan 24 14:48:54 2008
@@ -1211,13 +1211,13 @@
      <exports symbol='XML_SCHEMA_TYPE_SIMPLE' type='enum'/>
      <exports symbol='XML_SCHEMAS_NCNAME' type='enum'/>
      <exports symbol='XML_SCHEMAS_LONG' type='enum'/>
-     <exports symbol='XML_SCHEMA_FACET_FRACTIONDIGITS' type='enum'/>
+     <exports symbol='XML_SCHEMA_TYPE_ANY_ATTRIBUTE' type='enum'/>
      <exports symbol='XML_SCHEMAS_BOOLEAN' type='enum'/>
      <exports symbol='XML_SCHEMAS_ENTITY' type='enum'/>
      <exports symbol='XML_SCHEMA_TYPE_GROUP' type='enum'/>
      <exports symbol='XML_SCHEMAS_GYEARMONTH' type='enum'/>
      <exports symbol='XML_SCHEMAS_BASE64BINARY' type='enum'/>
-     <exports symbol='XML_SCHEMA_TYPE_ANY_ATTRIBUTE' type='enum'/>
+     <exports symbol='XML_SCHEMA_FACET_FRACTIONDIGITS' type='enum'/>
      <exports symbol='XML_SCHEMA_FACET_WHITESPACE' type='enum'/>
      <exports symbol='XML_SCHEMAS_IDREF' type='enum'/>
      <exports symbol='XML_SCHEMA_TYPE_ATTRIBUTE' type='enum'/>
@@ -1744,6 +1744,7 @@
      <exports symbol='xmlCopyDocElementContent' type='function'/>
      <exports symbol='xmlAddID' type='function'/>
      <exports symbol='xmlFreeRefTable' type='function'/>
+     <exports symbol='xmlValidateNamesValue' type='function'/>
      <exports symbol='xmlRemoveID' type='function'/>
      <exports symbol='xmlFreeElementTable' type='function'/>
      <exports symbol='xmlFreeIDTable' type='function'/>
@@ -1755,7 +1756,6 @@
      <exports symbol='xmlValidityWarningFunc' type='function'/>
      <exports symbol='xmlValidatePopElement' type='function'/>
      <exports symbol='xmlFreeEnumeration' type='function'/>
-     <exports symbol='xmlValidateNamesValue' type='function'/>
      <exports symbol='xmlCopyEnumeration' type='function'/>
      <exports symbol='xmlGetDtdAttrDesc' type='function'/>
      <exports symbol='xmlValidateDtd' type='function'/>
@@ -3452,15 +3452,15 @@
      <exports symbol='XPATH_ENCODING_ERROR' type='enum'/>
      <exports symbol='XPTR_RESOURCE_ERROR' type='enum'/>
      <exports symbol='XPATH_NUMBER' type='enum'/>
-     <exports symbol='XPATH_INVALID_CTXT_SIZE' type='enum'/>
+     <exports symbol='XPATH_POINT' type='enum'/>
      <exports symbol='XPATH_USERS' type='enum'/>
      <exports symbol='XPATH_UNDEF_PREFIX_ERROR' type='enum'/>
      <exports symbol='XPATH_UNKNOWN_FUNC_ERROR' type='enum'/>
+     <exports symbol='XPATH_INVALID_CTXT_SIZE' type='enum'/>
      <exports symbol='XPATH_RANGE' type='enum'/>
      <exports symbol='XPTR_SYNTAX_ERROR' type='enum'/>
      <exports symbol='XPATH_LOCATIONSET' type='enum'/>
      <exports symbol='XPATH_INVALID_CTXT' type='enum'/>
-     <exports symbol='XPATH_POINT' type='enum'/>
      <exports symbol='XPATH_INVALID_ARITY' type='enum'/>
      <exports symbol='XPATH_STRING' type='enum'/>
      <exports symbol='XPATH_INVALID_PREDICATE_ERROR' type='enum'/>

Modified: trunk/parser.c
==============================================================================
--- trunk/parser.c	(original)
+++ trunk/parser.c	Thu Jan 24 14:48:54 2008
@@ -5332,6 +5332,8 @@
 	    }
 	} else {
 	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
+	    if ((last != NULL) && (last != ret))
+	        xmlFreeDocElementContent(ctxt->myDoc, last);
 	    if (ret != NULL)
 		xmlFreeDocElementContent(ctxt->myDoc, ret);
 	    return(NULL);

Added: trunk/result/errors/content1.xml
==============================================================================

Added: trunk/result/errors/content1.xml.err
==============================================================================
--- (empty file)
+++ trunk/result/errors/content1.xml.err	Thu Jan 24 14:48:54 2008
@@ -0,0 +1,15 @@
+./test/errors/content1.xml:7: parser error : ContentDecl : ',' '|' or ')' expected
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : expected '>'
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : internal error
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : DOCTYPE improperly terminated
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : Start tag expected, '<' not found
+<!ELEMENT aElement (a |b * >
+                           ^

Added: trunk/result/errors/content1.xml.str
==============================================================================
--- (empty file)
+++ trunk/result/errors/content1.xml.str	Thu Jan 24 14:48:54 2008
@@ -0,0 +1,13 @@
+./test/errors/content1.xml:7: parser error : ContentDecl : ',' '|' or ')' expected
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : expected '>'
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : internal error
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : DOCTYPE improperly terminated
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml : failed to parse

Added: trunk/test/errors/content1.xml
==============================================================================
--- (empty file)
+++ trunk/test/errors/content1.xml	Thu Jan 24 14:48:54 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE root [
+<!ELEMENT root (#PCDATA)>
+<!ELEMENT a ANY>
+<!ELEMENT b ANY>
+<!--* missing closing bracket in choice *-->
+<!ELEMENT aElement (a |b * >
+]>
+<root>Any content</root>
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]