diff --git a/libxml2-2.7.4-input-parser.patch b/libxml2-2.7.4-input-parser.patch new file mode 100644 index 0000000..e82fa0f --- /dev/null +++ b/libxml2-2.7.4-input-parser.patch @@ -0,0 +1,33 @@ +commit 9d3d141c412baa5c713ad3df48f1a4d179e07b05 +Author: Daniel Veillard +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 "input->end - ctxt->input->cur) < 35) { ++ GROW; ++ } + if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) { + + /* diff --git a/libxml2.spec b/libxml2.spec index fd16e04..bfb59e9 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -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}-root 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 has been modified. %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 - 2.7.4-2 +- fix a problem with little data at startup affecting inkscape #523002 + * Thu Sep 10 2009 Daniel Veillard - 2.7.4-1 - upstream release 2.7.4 - symbol versioning of libxml2 shared libs