rpms/libxml2/F-11 libxml2-2.7.4-input-parser.patch, NONE, 1.1 libxml2.spec, 1.72, 1.73

Daniel Veillard veillard at fedoraproject.org
Tue Sep 15 17:07:27 UTC 2009


Author: veillard

Update of /cvs/pkgs/rpms/libxml2/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23367

Modified Files:
	libxml2.spec 
Added Files:
	libxml2-2.7.4-input-parser.patch 
Log Message:
Fix for #523002 affecting inkscpae and possibly others, daniel


libxml2-2.7.4-input-parser.patch:
 parser.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- NEW FILE libxml2-2.7.4-input-parser.patch ---
commit 9d3d141c412baa5c713ad3df48f1a4d179e07b05
Author: Daniel Veillard <veillard at redhat.com>
Date:   Tue Sep 15 18:41:30 2009 +0200

    Fix a parsing problem with little data at startup
    
    * parser.c: inkscape extension loader (and possibly others) feed
      data to the parser very slowly, 0 at start, 4 bytes on first GROW
      and this broke after the fix for
      https://bugzilla.gnome.org/show_bug.cgi?id=566012
      http://git.gnome.org/cgit/libxml2/commit/?id=7e385bd4e28a0cc12b6b26ed178c620e3c3ab8d8
      leading to another bug
      https://bugzilla.redhat.com/show_bug.cgi?id=523002
      this detects the situation and GROW when needed for proper processing.

diff --git a/parser.c b/parser.c
index e415339..b41dcc3 100644
--- a/parser.c
+++ b/parser.c
@@ -10130,8 +10130,12 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
     /*
      * Check for the XMLDecl in the Prolog.
      * do not GROW here to avoid the detected encoder to decode more
-     * than just the first line
+     * than just the first line, unless the amount of data is really
+     * too small to hold "<?xml version="1.0" encoding="foo"
      */
+    if ((ctxt->input->end - ctxt->input->cur) < 35) {
+       GROW;
+    }
     if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
 
 	/*


Index: libxml2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libxml2/F-11/libxml2.spec,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -p -r1.72 -r1.73
--- libxml2.spec	10 Sep 2009 17:48:16 -0000	1.72
+++ libxml2.spec	15 Sep 2009 17:07:27 -0000	1.73
@@ -1,7 +1,7 @@
 Summary: Library providing XML and HTML support
 Name: libxml2
 Version: 2.7.4
-Release: 1%{?dist}%{?extra_release}
+Release: 2%{?dist}%{?extra_release}
 License: MIT
 Group: Development/Libraries
 Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
@@ -9,6 +9,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version
 BuildRequires: python python-devel zlib-devel pkgconfig
 URL: http://xmlsoft.org/
 Patch0: libxml2-multilib.patch
+Patch1: libxml2-2.7.4-input-parser.patch
 
 %description
 This library allows to manipulate XML files. It includes support 
@@ -67,6 +68,7 @@ at parse time or later once the document
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure
@@ -141,6 +143,9 @@ rm -fr %{buildroot}
 %doc doc/python.html
 
 %changelog
+* Tue Sep 15 2009 Daniel Veillard <veillard at redhat.com> - 2.7.4-2
+- fix a problem with little data at startup affecting inkscape #523002
+
 * Thu Sep 10 2009 Daniel Veillard <veillard at redhat.com> - 2.7.4-1
 - upstream release 2.7.4
 - symbol versioning of libxml2 shared libs




More information about the scm-commits mailing list