From 730248e31b460fe2bc5709258f538e97af7108b1 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Mon, 12 Nov 2012 09:56:04 +0800 Subject: Fix udeb building --- debian/rules | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 5087e7a..433a41a 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,5 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 # The versions of python currently supported PYVERS=$(shell pyversions -s) @@ -24,7 +25,7 @@ $(if $(shell grep -q libxml2-udeb debian/control && echo yes),$(shell sed -i /li export DH_OPTIONS = -Nlibxml2-udeb endif -CONFIGURE_FLAGS := --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache" +CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache" override_dh_auto_configure: $(TARGETS:%=doconfigure-%) @@ -33,7 +34,8 @@ doconfigure-%: doconfigure-main: CONFIGURE_FLAGS += --without-python doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$* -doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output +#doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output +doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output override_dh_auto_build: $(TARGETS:%=dobuild-%) -- cgit v1.2.3 From fd980c4487256b74e5dd641eb14078d6bf31a047 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 28 Nov 2012 22:33:47 +0800 Subject: Fix potential out of bound access --- .../0005-Fix-potential-out-of-bound-access.patch | 22 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 23 insertions(+) create mode 100644 debian/patches/0005-Fix-potential-out-of-bound-access.patch (limited to 'debian') diff --git a/debian/patches/0005-Fix-potential-out-of-bound-access.patch b/debian/patches/0005-Fix-potential-out-of-bound-access.patch new file mode 100644 index 0000000..1e6396c --- /dev/null +++ b/debian/patches/0005-Fix-potential-out-of-bound-access.patch @@ -0,0 +1,22 @@ +From: Daniel Veillard +Date: Mon, 29 Oct 2012 02:39:55 +0000 +Subject: Fix potential out of bound access + +--- + parser.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index 192eaed..4519a70 100644 +--- a/parser.c ++++ b/parser.c +@@ -4075,7 +4075,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { + goto error; + + if ((in_space) && (normalize)) { +- while (buf[len - 1] == 0x20) len--; ++ while ((len > 0) && (buf[len - 1] == 0x20)) len--; + } + buf[len] = 0; + if (RAW == '<') { +-- diff --git a/debian/patches/series b/debian/patches/series index 2caba13..cd4a7d3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ 0002-rand_seed-should-be-static-in-dict.c.patch 0003-Fix-a-thread-portability-problem.patch 0004-link-libxml2mod-first.patch +0005-Fix-potential-out-of-bound-access.patch -- cgit v1.2.3 From 9d7028193a98a8b244dbfbfa32b23a53ccdd239e Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 28 Nov 2012 22:36:16 +0800 Subject: Update changelog --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 32c9cc7..7ec96bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libxml2 (2.9.0+dfsg1-4) experimental; urgency=low + + [ Daniel Veillard ] + * Fix potential out of bound access + CVE-2012-5134, Closes: #694521. + + -- Aron Xu Wed, 28 Nov 2012 22:34:15 +0800 + libxml2 (2.9.0+dfsg1-3) experimental; urgency=low [ Aron Xu ] -- cgit v1.2.3 From f63fd461538ac3079e2ae56e60ab007ed12c9e35 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 00:18:53 +0800 Subject: Remove patches applied upstream --- ...0002-rand_seed-should-be-static-in-dict.c.patch | 28 ------------------ .../0003-Fix-a-thread-portability-problem.patch | 34 ---------------------- debian/patches/0004-link-libxml2mod-first.patch | 24 --------------- .../0005-Fix-potential-out-of-bound-access.patch | 22 -------------- debian/patches/series | 4 --- 5 files changed, 112 deletions(-) delete mode 100644 debian/patches/0002-rand_seed-should-be-static-in-dict.c.patch delete mode 100644 debian/patches/0003-Fix-a-thread-portability-problem.patch delete mode 100644 debian/patches/0004-link-libxml2mod-first.patch delete mode 100644 debian/patches/0005-Fix-potential-out-of-bound-access.patch (limited to 'debian') diff --git a/debian/patches/0002-rand_seed-should-be-static-in-dict.c.patch b/debian/patches/0002-rand_seed-should-be-static-in-dict.c.patch deleted file mode 100644 index 163a846..0000000 --- a/debian/patches/0002-rand_seed-should-be-static-in-dict.c.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Wouter Van Rooy -Date: Fri, 14 Sep 2012 14:39:42 +0800 -Subject: rand_seed should be static in dict.c - -For https://bugzilla.gnome.org/show_bug.cgi?id=683933 -rand_seed should be a static variable in dict.c - -We ran into a problem with another library that exports rand_seed as a -function. Combined with 2.7.8 this was not a problem but later versions -have this problem. ---- - dict.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dict.c b/dict.c -index 9935a25..164c7f2 100644 ---- a/dict.c -+++ b/dict.c -@@ -143,7 +143,7 @@ static int xmlDictInitialized = 0; - /* - * Internal data for random function, protected by xmlDictMutex - */ --unsigned int rand_seed = 0; -+static unsigned int rand_seed = 0; - #endif - #endif - --- diff --git a/debian/patches/0003-Fix-a-thread-portability-problem.patch b/debian/patches/0003-Fix-a-thread-portability-problem.patch deleted file mode 100644 index 07e3583..0000000 --- a/debian/patches/0003-Fix-a-thread-portability-problem.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Friedrich Haubensak -Date: Wed, 12 Sep 2012 17:34:53 +0200 -Subject: Fix a thread portability problem - -cannot compile libxml2-2.9.0 using studio 12.1 compiler on solaris 10 - -I.M.O. structure initializer (as PTHREAD_ONCE_INIT) cannot be used in -a structure assignment anyway ---- - threads.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/threads.c b/threads.c -index f206149..7e85a26 100644 ---- a/threads.c -+++ b/threads.c -@@ -146,6 +146,7 @@ struct _xmlRMutex { - static pthread_key_t globalkey; - static pthread_t mainthread; - static pthread_once_t once_control = PTHREAD_ONCE_INIT; -+static pthread_once_t once_control_init = PTHREAD_ONCE_INIT; - static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER; - #elif defined HAVE_WIN32_THREADS - #if defined(HAVE_COMPILER_TLS) -@@ -915,7 +916,7 @@ xmlCleanupThreads(void) - #ifdef HAVE_PTHREAD_H - if ((libxml_is_threaded) && (pthread_key_delete != NULL)) - pthread_key_delete(globalkey); -- once_control = PTHREAD_ONCE_INIT; -+ once_control = once_control_init; - #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) - if (globalkey != TLS_OUT_OF_INDEXES) { - xmlGlobalStateCleanupHelperParams *p; --- diff --git a/debian/patches/0004-link-libxml2mod-first.patch b/debian/patches/0004-link-libxml2mod-first.patch deleted file mode 100644 index 6b5a18c..0000000 --- a/debian/patches/0004-link-libxml2mod-first.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: YunQiang Su -Date: Sun, 28 Oct 2012 03:29:05 +0800 -Subject: link libxml2mod first - ---- - python/Makefile.am | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/python/Makefile.am b/python/Makefile.am -index 4a8b5d5..10724ec 100644 ---- a/python/Makefile.am -+++ b/python/Makefile.am -@@ -24,8 +24,8 @@ AM_CPPFLAGS = \ - python_LTLIBRARIES = libxml2mod.la - - libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c --libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS) -lpython$(PYTHON_VERSION) --libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version -+libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version \ -+ $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS) -lpython$(PYTHON_VERSION) - - BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c - --- diff --git a/debian/patches/0005-Fix-potential-out-of-bound-access.patch b/debian/patches/0005-Fix-potential-out-of-bound-access.patch deleted file mode 100644 index 1e6396c..0000000 --- a/debian/patches/0005-Fix-potential-out-of-bound-access.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Daniel Veillard -Date: Mon, 29 Oct 2012 02:39:55 +0000 -Subject: Fix potential out of bound access - ---- - parser.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/parser.c b/parser.c -index 192eaed..4519a70 100644 ---- a/parser.c -+++ b/parser.c -@@ -4075,7 +4075,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { - goto error; - - if ((in_space) && (normalize)) { -- while (buf[len - 1] == 0x20) len--; -+ while ((len > 0) && (buf[len - 1] == 0x20)) len--; - } - buf[len] = 0; - if (RAW == '<') { --- diff --git a/debian/patches/series b/debian/patches/series index cd4a7d3..d300eac 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1 @@ 0001-modify-xml2-config-and-pkgconfig-behaviour.patch -0002-rand_seed-should-be-static-in-dict.c.patch -0003-Fix-a-thread-portability-problem.patch -0004-link-libxml2mod-first.patch -0005-Fix-potential-out-of-bound-access.patch -- cgit v1.2.3 From 27593dae381a9dcbadfc37e151cee6130914fc4e Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 00:41:12 +0800 Subject: New changlog entry --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7ec96bc..e4b4447 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libxml2 (2.9.1+dfsg1-1) experimental; urgency=low + + * New upstream release (Closes: #696300, #705722). + * Add -llzma for static linking (Closes: #697382). + + -- Aron Xu Sun, 09 Jun 2013 00:34:16 +0800 + libxml2 (2.9.0+dfsg1-4) experimental; urgency=low [ Daniel Veillard ] -- cgit v1.2.3 From 02dac3832ffbabe3423517acb4c3c339ff69bb40 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 00:48:52 +0800 Subject: Add LZMA_LIBS for static linking --- ...1-modify-xml2-config-and-pkgconfig-behaviour.patch | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/debian/patches/0001-modify-xml2-config-and-pkgconfig-behaviour.patch b/debian/patches/0001-modify-xml2-config-and-pkgconfig-behaviour.patch index e4deba2..c5b16bb 100644 --- a/debian/patches/0001-modify-xml2-config-and-pkgconfig-behaviour.patch +++ b/debian/patches/0001-modify-xml2-config-and-pkgconfig-behaviour.patch @@ -5,15 +5,16 @@ Subject: modify xml2-config and pkgconfig behaviour --- configure.in | 2 +- libxml-2.0-uninstalled.pc.in | 3 ++- + libxml-2.0.pc.in | 2 +- xml2-config.1 | 4 ++++ xml2-config.in | 22 ++++++++++------------ - 4 files changed, 17 insertions(+), 14 deletions(-) + 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in -index 3d5f48b..836695c 100644 +index d449b11..668f233 100644 --- a/configure.in +++ b/configure.in -@@ -1376,7 +1376,7 @@ case "$host" in +@@ -1380,7 +1380,7 @@ case "$host" in *) M_LIBS="-lm" ;; esac @@ -34,6 +35,17 @@ index cab6834..af16ebc 100644 +Libs: -L${libdir} -lxml2 +Libs.private: @BASE_THREAD_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@ +diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in +index f5f5f03..0de667b 100644 +--- a/libxml-2.0.pc.in ++++ b/libxml-2.0.pc.in +@@ -9,5 +9,5 @@ Version: @VERSION@ + Description: libXML library version2. + Requires: + Libs: -L${libdir} -lxml2 +-Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ ++Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ @LZMA_LIBS@ + Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/xml2-config.1 b/xml2-config.1 index 8cf9858..7b4195d 100644 --- a/xml2-config.1 @@ -94,4 +106,3 @@ index 1957486..b764d83 100644 *) usage --- -- cgit v1.2.3 From ab854863f9aa4e4334dbff63d24dcb09e4bd3e2a Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 01:02:35 +0800 Subject: Update symbols --- debian/libxml2.symbols | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'debian') diff --git a/debian/libxml2.symbols b/debian/libxml2.symbols index b8473f2..374ef1d 100644 --- a/debian/libxml2.symbols +++ b/debian/libxml2.symbols @@ -39,6 +39,7 @@ libxml2.so.2 libxml2 #MINVER# (symver|optional)LIBXML2_2.7.4 2.7.4 (symver|optional)LIBXML2_2.8.0 2.8.0 (symver|optional)LIBXML2_2.9.0 2.9.0 + (symver|optional)LIBXML2_2.9.1 2.9.1 __docbDefaultSAXHandler@Base 2.6.27 __htmlDefaultSAXHandler@Base 2.6.27 __htmlParseContent@Base 2.6.27 @@ -62,6 +63,7 @@ libxml2.so.2 libxml2 #MINVER# __xmlGlobalInitMutexUnlock@Base 2.6.28 __xmlIOErr@Base 2.6.27 __xmlIndentTreeOutput@Base 2.6.27 + __xmlInitializeDict@Base 2.9.1 __xmlKeepBlanksDefaultValue@Base 2.6.27 __xmlLastError@Base 2.6.27 __xmlLineNumbersDefaultValue@Base 2.6.27 @@ -143,6 +145,7 @@ libxml2.so.2 libxml2 #MINVER# xmlGenericErrorDefaultFunc@Base 2.6.27 xmlInitializeDict@LIBXML2_2.8.0 2.8.0 xmlMallocBreakpoint@Base 2.6.27 + xmlNop@Base 2.9.1 xmlNsListDumpOutput@Base 2.6.27 xmlOutputBufferCreateFilenameDefault@LIBXML2_2.6.11 2.8.0 xmlOutputBufferCreateFilenameValue@LIBXML2_2.6.11 2.8.0 @@ -163,4 +166,6 @@ libxml2.so.2 libxml2 #MINVER# xmlThrDefParserInputBufferCreateFilenameDefault@LIBXML2_2.6.11 2.8.0 xmlTextReaderRelaxNGValidateCtxt@LIBXML2_2.8.0 xmlUpgradeOldNs@Base 2.6.27 + xmlXPathNodeEval@LIBXML2_2.9.1 2.9.1 + xmlXPathSetContextNode@LIBXML2_2.9.1 2.9.1 xmlXPtrAdvanceNode@Base 2.6.27 -- cgit v1.2.3 From a6a65f815a6fabf144a2415389f900c5e5072c2f Mon Sep 17 00:00:00 2001 From: Bart Martens Date: Sun, 9 Jun 2013 01:11:02 +0800 Subject: Update debian/watch --- debian/watch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/watch b/debian/watch index fe56c31..ebd77f0 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,3 @@ version=3 -opts=dversionmangle=s/\.dfsg.*$// \ -ftp://xmlsoft.org/libxml2/libxml2-([\d\.]+)\.tar\.gz +opts=dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$//,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|BETA|beta|alpha|b|a)[\-\.]?\d*)$/$1~$2/ \ +ftp://xmlsoft.org/libxml2/libxml2-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) -- cgit v1.2.3 From c58e40488fc71d63aa166204648b800de380cf73 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 01:11:40 +0800 Subject: Update changelog --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e4b4447..306bd72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ libxml2 (2.9.1+dfsg1-1) experimental; urgency=low * New upstream release (Closes: #696300, #705722). * Add -llzma for static linking (Closes: #697382). + * Update symbols. + * Update debian/watch, thanks to Bart Martens. + * Use canonical Vcs-* fields. + * Mark python-libxml2-dbg as "Multi-Arch: same". -- Aron Xu Sun, 09 Jun 2013 00:34:16 +0800 -- cgit v1.2.3 From e9ab75b284681b6f363be37b9666425c68f5280d Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 9 Jun 2013 01:18:03 +0800 Subject: Use canonical Vcs-* field --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 9ac1283..e1fa438 100644 --- a/debian/control +++ b/debian/control @@ -8,8 +8,8 @@ Build-Depends: debhelper (>= 9), perl, dh-autoreconf, autotools-dev, binutils (>= 2.14.90.0.7), python-all-dev (>= 2.6.6-3~), python-all-dbg, zlib1g-dev | libz-dev, liblzma-dev, libreadline-dev | libreadline6-dev Homepage: http://xmlsoft.org/ -Vcs-Git: git://git.debian.org/debian-xml-sgml/libxml2.git -Vcs-Browser: http://git.debian.org/?p=debian-xml-sgml/libxml2.git +Vcs-Git: git://anonscm.debian.org/debian-xml-sgml/libxml2.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-xml-sgml/libxml2.git XS-Testsuite: autopkgtest Package: libxml2 -- cgit v1.2.3 From 9afca292b056860493ebcc41994f2278e5e31357 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Mon, 17 Jun 2013 23:25:32 +0800 Subject: Prepare to upload for unstable --- debian/changelog | 8 +++ .../0002-Fix-an-error-in-xmlCleanupParser.patch | 27 ++++++++++ ...ing-break-on-last-function-for-attributes.patch | 21 ++++++++ ...xmllint-memory-should-fail-on-empty-files.patch | 27 ++++++++++ ...ote-the-namespace-uris-written-out-during.patch | 32 ++++++++++++ ...ng-bug-on-non-ascii-element-and-CR-LF-usa.patch | 57 ++++++++++++++++++++++ debian/patches/series | 5 ++ 7 files changed, 177 insertions(+) create mode 100644 debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch create mode 100644 debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch create mode 100644 debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch create mode 100644 debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch create mode 100644 debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 306bd72..9b59004 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libxml2 (2.9.1+dfsg1-2) unstable; urgency=low + + * Upload to unstable. + * debian/patches/000[2-6]-*.patch: + - cherry-picking upstream post-release fixes. + + -- Aron Xu Mon, 17 Jun 2013 23:24:07 +0800 + libxml2 (2.9.1+dfsg1-1) experimental; urgency=low * New upstream release (Closes: #696300, #705722). diff --git a/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch b/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch new file mode 100644 index 0000000..03bf447 --- /dev/null +++ b/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch @@ -0,0 +1,27 @@ +From: Alexander Pastukhov +Date: Tue, 23 Apr 2013 05:02:11 +0000 +Subject: Fix an error in xmlCleanupParser + +https://bugzilla.gnome.org/show_bug.cgi?id=698582 + +xmlCleanupParser calls xmlCleanupGlobals() and then +xmlResetLastError() but the later reallocate the global +data freed by previous call. Just swap the two calls. +--- + parser.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index ee429f3..b9df6d8 100644 +--- a/parser.c ++++ b/parser.c +@@ -14763,8 +14763,8 @@ xmlCleanupParser(void) { + xmlSchemaCleanupTypes(); + xmlRelaxNGCleanupTypes(); + #endif +- xmlCleanupGlobals(); + xmlResetLastError(); ++ xmlCleanupGlobals(); + xmlCleanupThreads(); /* must be last if called not from the main thread */ + xmlCleanupMemory(); + xmlParserInitialized = 0; diff --git a/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch b/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch new file mode 100644 index 0000000..cff8b72 --- /dev/null +++ b/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch @@ -0,0 +1,21 @@ +From: dcb +Date: Thu, 2 May 2013 08:11:46 +0000 +Subject: Fix missing break on last() function for attributes + +pointed out by cppcheck +--- + python/libxml.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/python/libxml.c b/python/libxml.c +index 03cfb9f..3338b83 100644 +--- a/python/libxml.c ++++ b/python/libxml.c +@@ -2683,6 +2683,7 @@ libxml_last(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) + xmlAttrPtr attr = (xmlAttrPtr) cur; + + res = attr->last; ++ break; + } + default: + res = NULL; diff --git a/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch b/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch new file mode 100644 index 0000000..e1a2197 --- /dev/null +++ b/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch @@ -0,0 +1,27 @@ +From: Daniel Veillard +Date: Wed, 8 May 2013 05:45:48 +0000 +Subject: xmllint --memory should fail on empty files + +Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896 +when doing analysis but a priori unrelated. +--- + xmllint.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/xmllint.c b/xmllint.c +index 26d8db1..c0196ab 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + if (rectxt == NULL) + doc = xmlReadMemory((char *) base, info.st_size, diff --git a/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch b/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch new file mode 100644 index 0000000..6f4c4c8 --- /dev/null +++ b/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch @@ -0,0 +1,32 @@ +From: Aleksey Sanin +Date: Thu, 9 May 2013 16:02:16 +0000 +Subject: properly quote the namespace uris written out during c14n + +--- + c14n.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/c14n.c b/c14n.c +index afd95b3..ca77f92 100644 +--- a/c14n.c ++++ b/c14n.c +@@ -547,14 +547,15 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx) + if (ns->prefix != NULL) { + xmlOutputBufferWriteString(ctx->buf, " xmlns:"); + xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix); +- xmlOutputBufferWriteString(ctx->buf, "=\""); ++ xmlOutputBufferWriteString(ctx->buf, "="); + } else { +- xmlOutputBufferWriteString(ctx->buf, " xmlns=\""); ++ xmlOutputBufferWriteString(ctx->buf, " xmlns="); + } + if(ns->href != NULL) { +- xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href); ++ xmlBufWriteQuotedString(ctx->buf->buffer, ns->href); ++ } else { ++ xmlOutputBufferWriteString(ctx->buf, "\"\""); + } +- xmlOutputBufferWriteString(ctx->buf, "\""); + return (1); + } + diff --git a/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch b/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch new file mode 100644 index 0000000..442fd11 --- /dev/null +++ b/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch @@ -0,0 +1,57 @@ +From: Daniel Veillard +Date: Wed, 22 May 2013 20:56:45 +0000 +Subject: Fix a parsing bug on non-ascii element and CR/LF usage + +https://bugzilla.gnome.org/show_bug.cgi?id=698550 + +Somehow the behaviour of the internal parser routine changed +slightly when encountering CR/LF, which led to a bug when +parsing document with non-ascii Names +--- + parser.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index b9df6d8..dd00399 100644 +--- a/parser.c ++++ b/parser.c +@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + int len = 0, l; + int c; + int count = 0; ++ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */ + + #ifdef DEBUG + nbParseNCNameComplex++; +@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + * Handler for more complex cases + */ + GROW; ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ + (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { +@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + } + len += l; + NEXTL(l); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + } + } +@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } +- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); ++ return(xmlDictLookup(ctxt->dict, end - len, len)); + } + + /** diff --git a/debian/patches/series b/debian/patches/series index d300eac..877bddb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,6 @@ 0001-modify-xml2-config-and-pkgconfig-behaviour.patch +0002-Fix-an-error-in-xmlCleanupParser.patch +0003-Fix-missing-break-on-last-function-for-attributes.patch +0004-xmllint-memory-should-fail-on-empty-files.patch +0005-properly-quote-the-namespace-uris-written-out-during.patch +0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch -- cgit v1.2.3 From f5080d27945c5067897c5158ed90029c4931afad Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Mon, 5 Aug 2013 11:04:47 +0800 Subject: Add upstream patch to fix XPath evaluation issue (Closes: #713146) --- ...07-Fix-XPath-optimization-with-predicates.patch | 27 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 28 insertions(+) create mode 100644 debian/patches/0007-Fix-XPath-optimization-with-predicates.patch (limited to 'debian') diff --git a/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch new file mode 100644 index 0000000..f24424a --- /dev/null +++ b/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch @@ -0,0 +1,27 @@ +From: Nick Wellnhofer +Date: Sun, 4 Aug 2013 22:15:11 +0000 +Subject: Fix XPath '//' optimization with predicates + +My attempt to optimize XPath expressions containing '//' caused a +regression reported in bug #695699. This commit disables the +optimization for expressions of the form '//foo[predicate]'. +--- + xpath.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xpath.c b/xpath.c +index 97410e7..a676989 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) + * internal representation. + */ + +- if ((op->ch1 != -1) && +- (op->op == XPATH_OP_COLLECT /* 11 */)) ++ if ((op->op == XPATH_OP_COLLECT /* 11 */) && ++ (op->ch1 != -1) && ++ (op->ch2 == -1 /* no predicate */)) + { + xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; + diff --git a/debian/patches/series b/debian/patches/series index 877bddb..cae4aea 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 0004-xmllint-memory-should-fail-on-empty-files.patch 0005-properly-quote-the-namespace-uris-written-out-during.patch 0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch +0007-Fix-XPath-optimization-with-predicates.patch -- cgit v1.2.3 From 7cb660d52b244da9fed9a23fcf46f12d0b10ae1a Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Mon, 5 Aug 2013 11:04:57 +0800 Subject: Update changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 9b59004..5433d31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libxml2 (2.9.1+dfsg1-3) unstable; urgency=low + + * debian/patches/0007-Fix-XPath-optimization-with-predicates.patch: + - Upstream patch to fix XPath evaluation issue. (Closes: #713146) + + -- Aron Xu Mon, 05 Aug 2013 11:02:43 +0800 + libxml2 (2.9.1+dfsg1-2) unstable; urgency=low * Upload to unstable. -- cgit v1.2.3 From b1e4b274037f43a953cb792e946ec68a60a4427f Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Tue, 6 Aug 2013 22:22:22 +0800 Subject: Remove binutils from B-D --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index e1fa438..6a818b7 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Debian XML/SGML Group Uploaders: Aron Xu , YunQiang Su Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9), perl, dh-autoreconf, autotools-dev, - binutils (>= 2.14.90.0.7), python-all-dev (>= 2.6.6-3~), python-all-dbg, + python-all-dev (>= 2.6.6-3~), python-all-dbg, zlib1g-dev | libz-dev, liblzma-dev, libreadline-dev | libreadline6-dev Homepage: http://xmlsoft.org/ Vcs-Git: git://anonscm.debian.org/debian-xml-sgml/libxml2.git -- cgit v1.2.3 From f6a6f11341236159ef82a3f244b08ea63026fa39 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Tue, 6 Aug 2013 22:25:00 +0800 Subject: Use correct $CC --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 433a41a..65a6132 100755 --- a/debian/rules +++ b/debian/rules @@ -7,8 +7,10 @@ PYVERS=$(shell pyversions -s) PYVER=$(shell pyversions -d) export DEB_BUILD_MAINT_OPTIONS=hardening=+all +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +CC = $(DEB_HOST_GNU_TYPE)-gcc CFLAGS = `dpkg-buildflags --get CFLAGS` -Wall LDFLAGS = `dpkg-buildflags --get LDFLAGS` -Wl,--as-needed CPPFLAGS = `dpkg-buildflags --get CPPFLAGS` -- cgit v1.2.3 From 6ffdf3fe4e53679d336b70ae83f5bcc7edb3ec6d Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Tue, 6 Aug 2013 22:27:25 +0800 Subject: Configure udeb without python --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 65a6132..2b32c75 100755 --- a/debian/rules +++ b/debian/rules @@ -37,7 +37,7 @@ doconfigure-%: doconfigure-main: CONFIGURE_FLAGS += --without-python doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$* #doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-minimum --with-tree --with-output -doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output +doconfigure-udeb: CONFIGURE_FLAGS += --without-history --with-tree --with-output --without-python override_dh_auto_build: $(TARGETS:%=dobuild-%) -- cgit v1.2.3 From 580a40ad256a84a87c3d8d4e4dbe9da5b0b5262f Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 04:27:54 +0800 Subject: Fix xmllit crash when --pretty is specified (LP: #923671) --- ...tty-crashed-without-following-numeric-arg.patch | 34 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch (limited to 'debian') diff --git a/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch new file mode 100644 index 0000000..f654008 --- /dev/null +++ b/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch @@ -0,0 +1,34 @@ +From: Tim Galeckas +Date: Thu, 29 Aug 2013 16:44:33 +0800 +Subject: xmllint --pretty crashed without following numeric argument + +https://bugzilla.gnome.org/show_bug.cgi?id=674789 + +We need to check for NULL argument before calling atoi() +--- + xmllint.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/xmllint.c b/xmllint.c +index c0196ab..506bff9 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -3375,11 +3375,13 @@ main(int argc, char **argv) { + (!strcmp(argv[i], "--pretty"))) { + i++; + #ifdef LIBXML_OUTPUT_ENABLED +- format = atoi(argv[i]); +- if (format == 1) { +- noblanks++; +- xmlKeepBlanksDefault(0); +- } ++ if (argv[i] != NULL) { ++ format = atoi(argv[i]); ++ if (format == 1) { ++ noblanks++; ++ xmlKeepBlanksDefault(0); ++ } ++ } + #endif /* LIBXML_OUTPUT_ENABLED */ + } + #ifdef LIBXML_READER_ENABLED diff --git a/debian/patches/series b/debian/patches/series index cae4aea..4dae346 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ 0005-properly-quote-the-namespace-uris-written-out-during.patch 0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch 0007-Fix-XPath-optimization-with-predicates.patch +0008-xmllint-pretty-crashed-without-following-numeric-arg.patch -- cgit v1.2.3 From afaa94f1cb45b89b143ae93652c6c74301c38213 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 9 Jul 2014 04:30:09 +0800 Subject: Do not build-depend on readline (Closes: #742350) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 6a818b7..47f63cf 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Aron Xu , YunQiang Su Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9), perl, dh-autoreconf, autotools-dev, python-all-dev (>= 2.6.6-3~), python-all-dbg, - zlib1g-dev | libz-dev, liblzma-dev, libreadline-dev | libreadline6-dev + zlib1g-dev | libz-dev, liblzma-dev Homepage: http://xmlsoft.org/ Vcs-Git: git://anonscm.debian.org/debian-xml-sgml/libxml2.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-xml-sgml/libxml2.git -- cgit v1.2.3 From 8fe5303118a603f08165a91cf7890e3349a0d0a6 Mon Sep 17 00:00:00 2001 From: Daniel Schepler Date: Wed, 9 Jul 2014 04:32:55 +0800 Subject: Patch to bootstrap without python (Closes: #738080) --- debian/rules | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 2b32c75..9faf17d 100755 --- a/debian/rules +++ b/debian/rules @@ -27,6 +27,11 @@ $(if $(shell grep -q libxml2-udeb debian/control && echo yes),$(shell sed -i /li export DH_OPTIONS = -Nlibxml2-udeb endif +ifeq ($(DEB_BUILD_PROFILE),stage1) +DH_OPTIONS += -Npython-libxml2 -Npython-libxml2-dbg +export DH_OPTIONS +endif + CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" --cache-file="$(CURDIR)/builddir/config.cache" override_dh_auto_configure: $(TARGETS:%=doconfigure-%) @@ -105,14 +110,18 @@ override_dh_installchangelogs: override_dh_install: dh_install -Npython-libxml2-dbg -Nlibxml2-udeb +ifneq ($(DEB_BUILD_PROFILE),stage1) dh_install -ppython-libxml2-dbg --sourcedir=debian/tmp-dbg +endif dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb sed -i -e 's,/lib/$(DEB_HOST_MULTIARCH),/lib,' debian/libxml2-dev/usr/bin/xml2-config override_dh_strip: dh_strip -a --dbg-package=libxml2-dbg -Nlibxml2-udeb -Nlibxml2-utils -Nlibxml2-utils-dbg -Npython-libxml2 -Npython-libxml2-dbg dh_strip -plibxml2-utils --dbg-package=libxml2-utils-dbg +ifneq ($(DEB_BUILD_PROFILE),stage1) dh_strip -ppython-libxml2 --dbg-package=python-libxml2-dbg +endif $(foreach python, $(filter-out $(PYVER), $(PYVERS)),\ cd $(CURDIR)/debian/python-libxml2/usr/lib/pyshared; \ if diff $(python)/libxml2mod.so $(PYVER)/libxml2mod.so > /dev/null 2>&1; then \ @@ -125,6 +134,10 @@ override_dh_makeshlibs: dh_makeshlibs -a $(if $(WITH_UDEB),--add-udeb=libxml2-udeb )-V 'libxml2 (>= 2.7.4)' -- -c4 %: +ifeq ($(DEB_BUILD_PROFILE),stage1) + dh $@ --with autoreconf +else dh $@ --with autoreconf,python2 +endif -- cgit v1.2.3 From 20b6bde61412aea3ba50fee9ad679a422cfff3ff Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 9 Jul 2014 04:34:28 +0800 Subject: Drop unneeded B-D on perl (Closes: #753005) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 47f63cf..bd4ef20 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Section: libs Maintainer: Debian XML/SGML Group Uploaders: Aron Xu , YunQiang Su Standards-Version: 3.9.4 -Build-Depends: debhelper (>= 9), perl, dh-autoreconf, autotools-dev, +Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, python-all-dev (>= 2.6.6-3~), python-all-dbg, zlib1g-dev | libz-dev, liblzma-dev Homepage: http://xmlsoft.org/ -- cgit v1.2.3 From ad8b2111a0e5330aca1739fcf35658376b2970a8 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 05:15:30 +0800 Subject: New round of cherry-picking upstream fixes --- ...07-Fix-XPath-optimization-with-predicates.patch | 27 ---- debian/patches/0007-missing-else-in-xlink.c.patch | 22 +++ ...8-Catch-malloc-error-and-exit-accordingly.patch | 24 ++++ ...tty-crashed-without-following-numeric-arg.patch | 34 ----- .../patches/0009-Fix-handling-of-mmap-errors.patch | 51 +++++++ .../0010-Avoid-crash-if-allocation-fails.patch | 25 ++++ .../0011-Fix-a-possible-NULL-dereference.patch | 30 +++++ ...012-Clear-up-a-potential-NULL-dereference.patch | 26 ++++ ...13-Fix-XPath-optimization-with-predicates.patch | 27 ++++ ...tty-crashed-without-following-numeric-arg.patch | 34 +++++ ...al-NULL-pointer-dereferences-in-regexp-co.patch | 45 +++++++ ...a-potential-NULL-dereference-in-tree-code.patch | 26 ++++ ...ix-pointer-dereferenced-before-null-check.patch | 25 ++++ ...8-Fix-a-bug-loading-some-compressed-files.patch | 69 ++++++++++ ...-possibility-of-dangling-encoding-handler.patch | 57 ++++++++ .../0020-Fix-a-couple-of-missing-NULL-checks.patch | 29 ++++ ...-calls-to-xml-and-html-Read-parsing-entry.patch | 148 +++++++++++++++++++++ ...of-XPath-function-arguments-in-error-case.patch | 41 ++++++ ...ing-initialization-for-the-catalog-module.patch | 22 +++ .../0024-Fix-an-fd-leak-in-an-error-case.patch | 24 ++++ ...-fixing-a-ptotential-uninitialized-access.patch | 21 +++ ...WriterWriteElement-when-a-null-content-is.patch | 29 ++++ ...Avoid-a-possible-NULL-pointer-dereference.patch | 22 +++ ...-Do-not-fetch-external-parameter-entities.patch | 35 +++++ ...ble-null-pointer-dereference-in-memory-de.patch | 32 +++++ ...0-xmllint-was-not-parsing-the-c14n11-flag.patch | 22 +++ ...essions-introduced-by-CVE-2014-0191-patch.patch | 58 ++++++++ debian/patches/series | 27 +++- 28 files changed, 969 insertions(+), 63 deletions(-) delete mode 100644 debian/patches/0007-Fix-XPath-optimization-with-predicates.patch create mode 100644 debian/patches/0007-missing-else-in-xlink.c.patch create mode 100644 debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch delete mode 100644 debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch create mode 100644 debian/patches/0009-Fix-handling-of-mmap-errors.patch create mode 100644 debian/patches/0010-Avoid-crash-if-allocation-fails.patch create mode 100644 debian/patches/0011-Fix-a-possible-NULL-dereference.patch create mode 100644 debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch create mode 100644 debian/patches/0013-Fix-XPath-optimization-with-predicates.patch create mode 100644 debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch create mode 100644 debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch create mode 100644 debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch create mode 100644 debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch create mode 100644 debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch create mode 100644 debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch create mode 100644 debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch create mode 100644 debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch create mode 100644 debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch create mode 100644 debian/patches/0023-Missing-initialization-for-the-catalog-module.patch create mode 100644 debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch create mode 100644 debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch create mode 100644 debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch create mode 100644 debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch create mode 100644 debian/patches/0028-Do-not-fetch-external-parameter-entities.patch create mode 100644 debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch create mode 100644 debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch create mode 100644 debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch (limited to 'debian') diff --git a/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch deleted file mode 100644 index f24424a..0000000 --- a/debian/patches/0007-Fix-XPath-optimization-with-predicates.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Nick Wellnhofer -Date: Sun, 4 Aug 2013 22:15:11 +0000 -Subject: Fix XPath '//' optimization with predicates - -My attempt to optimize XPath expressions containing '//' caused a -regression reported in bug #695699. This commit disables the -optimization for expressions of the form '//foo[predicate]'. ---- - xpath.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/xpath.c b/xpath.c -index 97410e7..a676989 100644 ---- a/xpath.c -+++ b/xpath.c -@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) - * internal representation. - */ - -- if ((op->ch1 != -1) && -- (op->op == XPATH_OP_COLLECT /* 11 */)) -+ if ((op->op == XPATH_OP_COLLECT /* 11 */) && -+ (op->ch1 != -1) && -+ (op->ch2 == -1 /* no predicate */)) - { - xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; - diff --git a/debian/patches/0007-missing-else-in-xlink.c.patch b/debian/patches/0007-missing-else-in-xlink.c.patch new file mode 100644 index 0000000..88a4e86 --- /dev/null +++ b/debian/patches/0007-missing-else-in-xlink.c.patch @@ -0,0 +1,22 @@ +From: Ami Fischman +Date: Tue, 2 Jul 2013 09:47:26 +0800 +Subject: missing else in xlink.c + +Obviously forgotten +--- + xlink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xlink.c b/xlink.c +index 3566e06..c0e4ff3 100644 +--- a/xlink.c ++++ b/xlink.c +@@ -150,7 +150,7 @@ xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { + if (type != NULL) { + if (xmlStrEqual(type, BAD_CAST "simple")) { + ret = XLINK_TYPE_SIMPLE; +- } if (xmlStrEqual(type, BAD_CAST "extended")) { ++ } else if (xmlStrEqual(type, BAD_CAST "extended")) { + role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE); + if (role != NULL) { + xmlNsPtr xlink; diff --git a/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch b/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch new file mode 100644 index 0000000..3f93a57 --- /dev/null +++ b/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch @@ -0,0 +1,24 @@ +From: Daniel Veillard +Date: Thu, 11 Jul 2013 15:41:22 +0800 +Subject: Catch malloc error and exit accordingly + +As pointed privately by Bill Parker +--- + xmllint.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xmllint.c b/xmllint.c +index c0196ab..4d464e4 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -3090,6 +3090,10 @@ static void usage(const char *name) { + static void registerNode(xmlNodePtr node) + { + node->_private = malloc(sizeof(long)); ++ if (node->_private == NULL) { ++ fprintf(stderr, "Out of memory in xmllint:registerNode()\n"); ++ exit(XMLLINT_ERR_MEM); ++ } + *(long*)node->_private = (long) 0x81726354; + nbregister++; + } diff --git a/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch deleted file mode 100644 index f654008..0000000 --- a/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Tim Galeckas -Date: Thu, 29 Aug 2013 16:44:33 +0800 -Subject: xmllint --pretty crashed without following numeric argument - -https://bugzilla.gnome.org/show_bug.cgi?id=674789 - -We need to check for NULL argument before calling atoi() ---- - xmllint.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/xmllint.c b/xmllint.c -index c0196ab..506bff9 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -3375,11 +3375,13 @@ main(int argc, char **argv) { - (!strcmp(argv[i], "--pretty"))) { - i++; - #ifdef LIBXML_OUTPUT_ENABLED -- format = atoi(argv[i]); -- if (format == 1) { -- noblanks++; -- xmlKeepBlanksDefault(0); -- } -+ if (argv[i] != NULL) { -+ format = atoi(argv[i]); -+ if (format == 1) { -+ noblanks++; -+ xmlKeepBlanksDefault(0); -+ } -+ } - #endif /* LIBXML_OUTPUT_ENABLED */ - } - #ifdef LIBXML_READER_ENABLED diff --git a/debian/patches/0009-Fix-handling-of-mmap-errors.patch b/debian/patches/0009-Fix-handling-of-mmap-errors.patch new file mode 100644 index 0000000..0c55cfe --- /dev/null +++ b/debian/patches/0009-Fix-handling-of-mmap-errors.patch @@ -0,0 +1,51 @@ +From: Daniel Veillard +Date: Fri, 12 Jul 2013 12:08:40 +0800 +Subject: Fix handling of mmap errors + +https://bugzilla.gnome.org/show_bug.cgi?id=702320 + +as raised by Gaurav +--- + xmllint.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/xmllint.c b/xmllint.c +index 4d464e4..92e6b03 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -1837,8 +1837,12 @@ static void streamFile(char *filename) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ close(fd); ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + reader = xmlReaderForMemory(base, info.st_size, filename, + NULL, options); +@@ -2223,8 +2227,12 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ close(fd); ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + doc = htmlReadMemory((char *) base, info.st_size, filename, + NULL, options); +@@ -2339,6 +2347,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; + if (base == (void *) MAP_FAILED) { ++ close(fd); + fprintf(stderr, "mmap failure for file %s\n", filename); + progresult = XMLLINT_ERR_RDFILE; + return; diff --git a/debian/patches/0010-Avoid-crash-if-allocation-fails.patch b/debian/patches/0010-Avoid-crash-if-allocation-fails.patch new file mode 100644 index 0000000..e4e7206 --- /dev/null +++ b/debian/patches/0010-Avoid-crash-if-allocation-fails.patch @@ -0,0 +1,25 @@ +From: Daniel Veillard +Date: Mon, 22 Jul 2013 14:28:20 +0800 +Subject: Avoid crash if allocation fails + +https://bugzilla.gnome.org/show_bug.cgi?id=704527 +xmlSchemaNewValue() may fail on OOM error +--- + xmlschemastypes.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xmlschemastypes.c b/xmlschemastypes.c +index a9edc03..ec403e8 100644 +--- a/xmlschemastypes.c ++++ b/xmlschemastypes.c +@@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value) + } + ret->type = XML_SCHEMA_FACET_MINLENGTH; + ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER); ++ if (ret->val == NULL) { ++ xmlFree(ret); ++ return(NULL); ++ } + ret->val->value.decimal.lo = value; + return (ret); + } diff --git a/debian/patches/0011-Fix-a-possible-NULL-dereference.patch b/debian/patches/0011-Fix-a-possible-NULL-dereference.patch new file mode 100644 index 0000000..9a7cf6f --- /dev/null +++ b/debian/patches/0011-Fix-a-possible-NULL-dereference.patch @@ -0,0 +1,30 @@ +From: Gaurav +Date: Sat, 3 Aug 2013 22:16:02 +0800 +Subject: Fix a possible NULL dereference + +https://bugzilla.gnome.org/show_bug.cgi?id=705400 +In case of allocation error the pointer was dereferenced before the +test for a failure +--- + SAX2.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/SAX2.c b/SAX2.c +index 4adf202..33d167e 100644 +--- a/SAX2.c ++++ b/SAX2.c +@@ -994,12 +994,12 @@ xmlSAX2StartDocument(void *ctx) + #ifdef LIBXML_HTML_ENABLED + if (ctxt->myDoc == NULL) + ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); +- ctxt->myDoc->properties = XML_DOC_HTML; +- ctxt->myDoc->parseFlags = ctxt->options; + if (ctxt->myDoc == NULL) { + xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument"); + return; + } ++ ctxt->myDoc->properties = XML_DOC_HTML; ++ ctxt->myDoc->parseFlags = ctxt->options; + #else + xmlGenericError(xmlGenericErrorContext, + "libxml2 built without HTML support\n"); diff --git a/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch b/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch new file mode 100644 index 0000000..a18dfaf --- /dev/null +++ b/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch @@ -0,0 +1,26 @@ +From: Daniel Veillard +Date: Sat, 3 Aug 2013 22:25:13 +0800 +Subject: Clear up a potential NULL dereference + +https://bugzilla.gnome.org/show_bug.cgi?id=705399 + +if ctxt->node_seq.buffer is null then ctxt->node_seq.maximum ought +to be zero but it's better to clarify the check in the code directly. +--- + parserInternals.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/parserInternals.c b/parserInternals.c +index f8a7041..98a5836 100644 +--- a/parserInternals.c ++++ b/parserInternals.c +@@ -1990,7 +1990,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, + + /* Otherwise, we need to add new node to buffer */ + else { +- if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) { ++ if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) || ++ (ctxt->node_seq.buffer == NULL)) { + xmlParserNodeInfo *tmp_buffer; + unsigned int byte_size; + diff --git a/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch new file mode 100644 index 0000000..f24424a --- /dev/null +++ b/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch @@ -0,0 +1,27 @@ +From: Nick Wellnhofer +Date: Sun, 4 Aug 2013 22:15:11 +0000 +Subject: Fix XPath '//' optimization with predicates + +My attempt to optimize XPath expressions containing '//' caused a +regression reported in bug #695699. This commit disables the +optimization for expressions of the form '//foo[predicate]'. +--- + xpath.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xpath.c b/xpath.c +index 97410e7..a676989 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) + * internal representation. + */ + +- if ((op->ch1 != -1) && +- (op->op == XPATH_OP_COLLECT /* 11 */)) ++ if ((op->op == XPATH_OP_COLLECT /* 11 */) && ++ (op->ch1 != -1) && ++ (op->ch2 == -1 /* no predicate */)) + { + xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; + diff --git a/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch new file mode 100644 index 0000000..b910c3a --- /dev/null +++ b/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch @@ -0,0 +1,34 @@ +From: Tim Galeckas +Date: Thu, 29 Aug 2013 16:44:33 +0800 +Subject: xmllint --pretty crashed without following numeric argument + +https://bugzilla.gnome.org/show_bug.cgi?id=674789 + +We need to check for NULL argument before calling atoi() +--- + xmllint.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/xmllint.c b/xmllint.c +index 92e6b03..d69722c 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -3388,11 +3388,13 @@ main(int argc, char **argv) { + (!strcmp(argv[i], "--pretty"))) { + i++; + #ifdef LIBXML_OUTPUT_ENABLED +- format = atoi(argv[i]); +- if (format == 1) { +- noblanks++; +- xmlKeepBlanksDefault(0); +- } ++ if (argv[i] != NULL) { ++ format = atoi(argv[i]); ++ if (format == 1) { ++ noblanks++; ++ xmlKeepBlanksDefault(0); ++ } ++ } + #endif /* LIBXML_OUTPUT_ENABLED */ + } + #ifdef LIBXML_READER_ENABLED diff --git a/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch b/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch new file mode 100644 index 0000000..fa8a176 --- /dev/null +++ b/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch @@ -0,0 +1,45 @@ +From: Gaurav +Date: Wed, 11 Sep 2013 14:59:06 +0800 +Subject: Fix potential NULL pointer dereferences in regexp code + +https://bugzilla.gnome.org/show_bug.cgi?id=707749 + +Fix 3 cases where we might dereference NULL +--- + xmlregexp.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/xmlregexp.c b/xmlregexp.c +index 1f9911c..8e63d74 100644 +--- a/xmlregexp.c ++++ b/xmlregexp.c +@@ -3162,8 +3162,10 @@ xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) { + exec->status = -6; + return; + } +- memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, ++ if (exec->counts) { ++ memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, + exec->comp->nbCounters * sizeof(int)); ++ } + } + + #ifdef DEBUG_REGEXP_EXEC +@@ -4091,7 +4093,7 @@ rollback: + */ + exec->determinist = 0; + xmlFARegExecRollBack(exec); +- if (exec->status == 0) { ++ if ((exec->inputStack != NULL ) && (exec->status == 0)) { + value = exec->inputStack[exec->index].value; + data = exec->inputStack[exec->index].data; + #ifdef DEBUG_PUSH +@@ -4306,7 +4308,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, + (*nbval)++; + } + } else { +- if ((exec->comp->states[trans->to] != NULL) && ++ if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) && + (exec->comp->states[trans->to]->type != + XML_REGEXP_SINK_STATE)) { + if (atom->neg) diff --git a/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch b/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch new file mode 100644 index 0000000..2c55813 --- /dev/null +++ b/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch @@ -0,0 +1,26 @@ +From: Daniel Veillard +Date: Wed, 11 Sep 2013 15:11:27 +0800 +Subject: Fix a potential NULL dereference in tree code + +https://bugzilla.gnome.org/show_bug.cgi?id=707750 + +Also reported by Gaurav, simple fix to check the pointer before +dereference +--- + tree.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tree.c b/tree.c +index 7e5af26..efc3ca2 100644 +--- a/tree.c ++++ b/tree.c +@@ -9780,7 +9780,8 @@ leave_node: + if (clone->parent != NULL) + clone->parent->last = clone; + clone = clone->parent; +- parentClone = clone->parent; ++ if (clone != NULL) ++ parentClone = clone->parent; + /* + * Process parent --> next; + */ diff --git a/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch b/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch new file mode 100644 index 0000000..3ae1c59 --- /dev/null +++ b/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch @@ -0,0 +1,25 @@ +From: Gaurav +Date: Mon, 30 Sep 2013 10:43:47 +0800 +Subject: Fix pointer dereferenced before null check + +for https://bugzilla.gnome.org/show_bug.cgi?id=708364 + +xmlValidateElementContent is a private function but should still +check the ctxt argument before dereferencing +--- + valid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/valid.c b/valid.c +index 6e53a76..e0832e7 100644 +--- a/valid.c ++++ b/valid.c +@@ -5236,7 +5236,7 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child, + xmlElementContentPtr cont; + const xmlChar *name; + +- if ((elemDecl == NULL) || (parent == NULL)) ++ if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL)) + return(-1); + cont = elemDecl->content; + name = elemDecl->name; diff --git a/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch b/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch new file mode 100644 index 0000000..48b4fa4 --- /dev/null +++ b/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch @@ -0,0 +1,69 @@ +From: Mike Alexander +Date: Thu, 28 Nov 2013 23:21:23 +0800 +Subject: Fix a bug loading some compressed files + +For https://bugzilla.gnome.org/show_bug.cgi?id=712528 +Related to https://bugzilla.redhat.com/show_bug.cgi?id=877567 + +There is a bug in xzlib.c which causes certain compressed XML files to fail to +load correctly. The code in xz_decomp which attempts to verify the checksum +and length of the expanded data fails if the checksum or length at the end of +the file crosses a 1024 byte boundary. It calls gz_next4 to get those two +values. This function uses the stream state in state->zstrm, but calls +xz_avail which uses the state->strm stream info. This causes gz_next4 to +signal a premature EOF if the data it is fetching crosses a 1024 byte boundary. +--- + xzlib.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/xzlib.c b/xzlib.c +index 928bd17..cd045fa 100644 +--- a/xzlib.c ++++ b/xzlib.c +@@ -245,6 +245,20 @@ xz_avail(xz_statep state) + return 0; + } + ++#ifdef HAVE_ZLIB_H ++static int ++xz_avail_zstrm(xz_statep state) ++{ ++ int ret; ++ state->strm.avail_in = state->zstrm.avail_in; ++ state->strm.next_in = state->zstrm.next_in; ++ ret = xz_avail(state); ++ state->zstrm.avail_in = (uInt) state->strm.avail_in; ++ state->zstrm.next_in = (Bytef *) state->strm.next_in; ++ return ret; ++} ++#endif ++ + static int + is_format_xz(xz_statep state) + { +@@ -314,6 +328,10 @@ is_format_lzma(xz_statep state) + #define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \ + (strm->avail_in == 0 ? -1 : \ + (strm->avail_in--, *(strm->next_in)++))) ++/* Same thing, but from zstrm */ ++#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \ ++ (strm->avail_in == 0 ? -1 : \ ++ (strm->avail_in--, *(strm->next_in)++))) + + /* Get a four-byte little-endian integer and return 0 on success and the value + in *ret. Otherwise -1 is returned and *ret is not modified. */ +@@ -324,10 +342,10 @@ gz_next4(xz_statep state, unsigned long *ret) + unsigned long val; + z_streamp strm = &(state->zstrm); + +- val = NEXT(); +- val += (unsigned) NEXT() << 8; +- val += (unsigned long) NEXT() << 16; +- ch = NEXT(); ++ val = NEXTZ(); ++ val += (unsigned) NEXTZ() << 8; ++ val += (unsigned long) NEXTZ() << 16; ++ ch = NEXTZ(); + if (ch == -1) + return -1; + val += (unsigned long) ch << 24; diff --git a/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch b/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch new file mode 100644 index 0000000..ab0bde8 --- /dev/null +++ b/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch @@ -0,0 +1,57 @@ +From: Gaurav +Date: Fri, 29 Nov 2013 23:10:50 +0800 +Subject: Avoid a possibility of dangling encoding handler + +For https://bugzilla.gnome.org/show_bug.cgi?id=711149 + +In Function: +int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) + +If the freed handler is any one of handlers[i] list, then it will make that +hanldlers[i] as dangling. This may lead to crash issues at places where +handlers is read. +--- + encoding.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/encoding.c b/encoding.c +index 7330e90..d4fc45f 100644 +--- a/encoding.c ++++ b/encoding.c +@@ -2851,14 +2851,25 @@ int + xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { + int ret = 0; + int tofree = 0; ++ int i, handler_in_list = 0; ++ + if (handler == NULL) return(-1); + if (handler->name == NULL) return(-1); ++ if (handlers != NULL) { ++ for (i = 0;i < nbCharEncodingHandler; i++) { ++ if (handler == handlers[i]) { ++ handler_in_list = 1; ++ break; ++ } ++ } ++ } + #ifdef LIBXML_ICONV_ENABLED + /* + * Iconv handlers can be used only once, free the whole block. + * and the associated icon resources. + */ +- if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { ++ if ((handler_in_list == 0) && ++ ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) { + tofree = 1; + if (handler->iconv_out != NULL) { + if (iconv_close(handler->iconv_out)) +@@ -2873,7 +2884,8 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { + } + #endif /* LIBXML_ICONV_ENABLED */ + #ifdef LIBXML_ICU_ENABLED +- if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { ++ if ((handler_in_list == 0) && ++ ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) { + tofree = 1; + if (handler->uconv_out != NULL) { + closeIcuConverter(handler->uconv_out); diff --git a/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch b/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch new file mode 100644 index 0000000..6771dbb --- /dev/null +++ b/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch @@ -0,0 +1,29 @@ +From: Gaurav +Date: Fri, 29 Nov 2013 23:28:21 +0800 +Subject: Fix a couple of missing NULL checks + +For https://bugzilla.gnome.org/show_bug.cgi?id=708681 +--- + tree.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tree.c b/tree.c +index efc3ca2..43c3c57 100644 +--- a/tree.c ++++ b/tree.c +@@ -4294,6 +4294,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { + } + if (doc->intSubset == NULL) { + q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node ); ++ if (q == NULL) return(NULL); + q->doc = doc; + q->parent = parent; + doc->intSubset = (xmlDtdPtr) q; +@@ -4305,6 +4306,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { + } else + #endif /* LIBXML_TREE_ENABLED */ + q = xmlStaticCopyNode(node, doc, parent, 1); ++ if (q == NULL) return(NULL); + if (ret == NULL) { + q->prev = NULL; + ret = p = q; diff --git a/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch b/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch new file mode 100644 index 0000000..7820411 --- /dev/null +++ b/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch @@ -0,0 +1,148 @@ +From: Daniel Veillard +Date: Mon, 9 Dec 2013 15:23:40 +0800 +Subject: adding init calls to xml and html Read parsing entry points + +As pointed out by "Tassyns, Bram " on the list +some call had it other didn't, clean it up and add to all missing +ones +--- + HTMLparser.c | 6 ++++++ + parser.c | 10 ++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/HTMLparser.c b/HTMLparser.c +index dd0c1ea..44c1a3c 100644 +--- a/HTMLparser.c ++++ b/HTMLparser.c +@@ -6808,6 +6808,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) + + if (fd < 0) + return (NULL); ++ xmlInitParser(); + + xmlInitParser(); + input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); +@@ -6898,6 +6899,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -6931,6 +6933,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -6967,6 +6970,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, + return (NULL); + if (buffer == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -7009,6 +7013,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -7053,6 +7058,7 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +diff --git a/parser.c b/parser.c +index dd00399..ad400f4 100644 +--- a/parser.c ++++ b/parser.c +@@ -15217,6 +15217,7 @@ xmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int optio + + if (cur == NULL) + return (NULL); ++ xmlInitParser(); + + ctxt = xmlCreateDocParserCtxt(cur); + if (ctxt == NULL) +@@ -15239,6 +15240,7 @@ xmlReadFile(const char *filename, const char *encoding, int options) + { + xmlParserCtxtPtr ctxt; + ++ xmlInitParser(); + ctxt = xmlCreateURLParserCtxt(filename, options); + if (ctxt == NULL) + return (NULL); +@@ -15262,6 +15264,7 @@ xmlReadMemory(const char *buffer, int size, const char *URL, const char *encodin + { + xmlParserCtxtPtr ctxt; + ++ xmlInitParser(); + ctxt = xmlCreateMemoryParserCtxt(buffer, size); + if (ctxt == NULL) + return (NULL); +@@ -15290,6 +15293,7 @@ xmlReadFd(int fd, const char *URL, const char *encoding, int options) + + if (fd < 0) + return (NULL); ++ xmlInitParser(); + + input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); + if (input == NULL) +@@ -15333,6 +15337,7 @@ xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, + + if (ioread == NULL) + return (NULL); ++ xmlInitParser(); + + input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, + XML_CHAR_ENCODING_NONE); +@@ -15379,6 +15384,7 @@ xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15412,6 +15418,7 @@ xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15448,6 +15455,7 @@ xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, + return (NULL); + if (buffer == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15492,6 +15500,7 @@ xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15537,6 +15546,7 @@ xmlCtxtReadIO(xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + diff --git a/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch b/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch new file mode 100644 index 0000000..cc18db7 --- /dev/null +++ b/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch @@ -0,0 +1,41 @@ +From: Nick Wellnhofer +Date: Fri, 20 Dec 2013 00:01:53 +0100 +Subject: Handling of XPath function arguments in error case + +The XPath engine tries to guarantee that every XPath function can pop +'nargs' non-NULL values off the stack. libxslt, for example, relies on +this assumption. But the check isn't thorough enough if there are errors +during the evaluation of arguments. This can lead to segfaults: + +https://mail.gnome.org/archives/xslt/2013-December/msg00005.html + +This commit makes the handling of function arguments more robust. + +* Bail out early when evaluation of XPath function arguments fails. +* Make sure that there are 'nargs' arguments in the current call frame. +--- + xpath.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/xpath.c b/xpath.c +index a676989..a75df9b 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -13512,10 +13512,15 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + int frame; + + frame = xmlXPathSetFrame(ctxt); +- if (op->ch1 != -1) ++ if (op->ch1 != -1) { + total += + xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); +- if (ctxt->valueNr < op->value) { ++ if (ctxt->error != XPATH_EXPRESSION_OK) { ++ xmlXPathPopFrame(ctxt, frame); ++ return (total); ++ } ++ } ++ if (ctxt->valueNr < ctxt->valueFrame + op->value) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: parameter error\n"); + ctxt->error = XPATH_INVALID_OPERAND; diff --git a/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch b/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch new file mode 100644 index 0000000..c5a5d16 --- /dev/null +++ b/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch @@ -0,0 +1,22 @@ +From: Daniel Veillard +Date: Sun, 26 Jan 2014 15:02:25 +0100 +Subject: Missing initialization for the catalog module + +--- + parser.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/parser.c b/parser.c +index ad400f4..7381a78 100644 +--- a/parser.c ++++ b/parser.c +@@ -14720,6 +14720,9 @@ xmlInitParser(void) { + #ifdef LIBXML_XPATH_ENABLED + xmlXPathInit(); + #endif ++#ifdef LIBXML_CATALOG_ENABLED ++ xmlInitializeCatalog(); ++#endif + xmlParserInitialized = 1; + #ifdef LIBXML_THREAD_ENABLED + } diff --git a/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch b/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch new file mode 100644 index 0000000..edf1752 --- /dev/null +++ b/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch @@ -0,0 +1,24 @@ +From: Daniel Veillard +Date: Thu, 6 Feb 2014 10:38:00 +0100 +Subject: Fix an fd leak in an error case + +--- + catalog.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/catalog.c b/catalog.c +index 8e34cd2..56991da 100644 +--- a/catalog.c ++++ b/catalog.c +@@ -994,6 +994,11 @@ xmlLoadFileContent(const char *filename) + content = (xmlChar*)xmlMallocAtomic(size + 10); + if (content == NULL) { + xmlCatalogErrMemory("allocating catalog data"); ++#ifdef HAVE_STAT ++ close(fd); ++#else ++ fclose(fd); ++#endif + return (NULL); + } + #ifdef HAVE_STAT diff --git a/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch b/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch new file mode 100644 index 0000000..65eae92 --- /dev/null +++ b/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch @@ -0,0 +1,21 @@ +From: Daniel Veillard +Date: Thu, 6 Feb 2014 10:47:20 +0100 +Subject: fixing a ptotential uninitialized access + +--- + valid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/valid.c b/valid.c +index e0832e7..114bb72 100644 +--- a/valid.c ++++ b/valid.c +@@ -6948,7 +6948,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, + int max) { + xmlValidCtxt vctxt; + int nb_valid_elements = 0; +- const xmlChar *elements[256]; ++ const xmlChar *elements[256]={0}; + int nb_elements = 0, i; + const xmlChar *name; + diff --git a/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch b/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch new file mode 100644 index 0000000..22d206a --- /dev/null +++ b/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch @@ -0,0 +1,29 @@ +From: Daniel Veillard +Date: Sat, 8 Feb 2014 02:22:35 +0800 +Subject: Fix xmlTextWriterWriteElement when a null content is given + +--- + xmlwriter.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/xmlwriter.c b/xmlwriter.c +index d3f29f8..27209b9 100644 +--- a/xmlwriter.c ++++ b/xmlwriter.c +@@ -2238,10 +2238,12 @@ xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name, + if (count == -1) + return -1; + sum += count; +- count = xmlTextWriterWriteString(writer, content); +- if (count == -1) +- return -1; +- sum += count; ++ if (content != NULL) { ++ count = xmlTextWriterWriteString(writer, content); ++ if (count == -1) ++ return -1; ++ sum += count; ++ } + count = xmlTextWriterEndElement(writer); + if (count == -1) + return -1; diff --git a/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch b/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch new file mode 100644 index 0000000..219d13a --- /dev/null +++ b/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch @@ -0,0 +1,22 @@ +From: Gaurav +Date: Tue, 18 Feb 2014 11:47:43 +0800 +Subject: Avoid a possible NULL pointer dereference + +For https://bugzilla.gnome.org/show_bug.cgi?id=708355 +--- + xmlmodule.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xmlmodule.c b/xmlmodule.c +index 7fe5bc2..50ed666 100644 +--- a/xmlmodule.c ++++ b/xmlmodule.c +@@ -115,7 +115,7 @@ xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol) + { + int rc = -1; + +- if ((NULL == module) || (symbol == NULL)) { ++ if ((NULL == module) || (symbol == NULL) || (name == NULL)) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + NULL, NULL, 0, 0, "null parameter\n"); diff --git a/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch b/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch new file mode 100644 index 0000000..06ec27c --- /dev/null +++ b/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch @@ -0,0 +1,35 @@ +From: Daniel Veillard +Date: Tue, 22 Apr 2014 15:30:56 +0800 +Subject: Do not fetch external parameter entities + +Unless explicitely asked for when validating or replacing entities +with their value. Problem pointed out by Daniel Berrange +--- + parser.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/parser.c b/parser.c +index 7381a78..8aad7b4 100644 +--- a/parser.c ++++ b/parser.c +@@ -2595,6 +2595,20 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + xmlCharEncoding enc; + + /* ++ * Note: external parsed entities will not be loaded, it is ++ * not required for a non-validating parser, unless the ++ * option of validating, or substituting entities were ++ * given. Doing so is far more secure as the parser will ++ * only process data coming from the document entity by ++ * default. ++ */ ++ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && ++ ((ctxt->options & XML_PARSE_NOENT) == 0) && ++ ((ctxt->options & XML_PARSE_DTDVALID) == 0) && ++ (ctxt->validate == 0)) ++ return; ++ ++ /* + * handle the extra spaces added before and after + * c.f. http://www.w3.org/TR/REC-xml#as-PE + * this is done independently. diff --git a/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch b/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch new file mode 100644 index 0000000..8a84731 --- /dev/null +++ b/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch @@ -0,0 +1,32 @@ +From: Gaurav +Date: Fri, 9 May 2014 17:00:08 +0800 +Subject: Avoid Possible null pointer dereference in memory debug mode + +Fix a use before check on pointer +For https://bugzilla.gnome.org/show_bug.cgi?id=729849 +--- + xmlmemory.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xmlmemory.c b/xmlmemory.c +index 25d9318..37dcf3b 100644 +--- a/xmlmemory.c ++++ b/xmlmemory.c +@@ -583,13 +583,15 @@ xmlMemBlocks(void) { + static void + xmlMemContentShow(FILE *fp, MEMHDR *p) + { +- int i,j,k,len = p->mh_size; +- const char *buf = (const char *) HDR_2_CLIENT(p); ++ int i,j,k,len; ++ const char *buf; + + if (p == NULL) { + fprintf(fp, " NULL"); + return; + } ++ len = p->mh_size; ++ buf = (const char *) HDR_2_CLIENT(p); + + for (i = 0;i < len;i++) { + if (buf[i] == 0) break; diff --git a/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch b/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch new file mode 100644 index 0000000..7b24f6b --- /dev/null +++ b/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch @@ -0,0 +1,22 @@ +From: =?UTF-8?q?S=C3=A9rgio=20Batista?= +Date: Mon, 9 Jun 2014 22:10:15 +0800 +Subject: xmllint was not parsing the --c14n11 flag + +Cut and paste error, using the wrong variable +--- + xmllint.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xmllint.c b/xmllint.c +index d69722c..4a5d043 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -2573,7 +2573,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + fprintf(stderr, "Failed to canonicalize\n"); + progresult = XMLLINT_ERR_OUT; + } +- } else if (canonical) { ++ } else if (canonical_11) { + xmlChar *result = NULL; + int size; + diff --git a/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch b/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch new file mode 100644 index 0000000..d9fc108 --- /dev/null +++ b/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch @@ -0,0 +1,58 @@ +From: Daniel Veillard +Date: Wed, 11 Jun 2014 16:54:32 +0800 +Subject: Fix regressions introduced by CVE-2014-0191 patch + +A number of issues have been raised after the fix, and this patch +tries to correct all of them, though most were related to +postvalidation. +https://bugzilla.gnome.org/show_bug.cgi?id=730290 +and other reports on list, off-list and on Red Hat bugzilla +--- + parser.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/parser.c b/parser.c +index 8aad7b4..ea0ea65 100644 +--- a/parser.c ++++ b/parser.c +@@ -2595,8 +2595,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + xmlCharEncoding enc; + + /* +- * Note: external parsed entities will not be loaded, it is +- * not required for a non-validating parser, unless the ++ * Note: external parameter entities will not be loaded, it ++ * is not required for a non-validating parser, unless the + * option of validating, or substituting entities were + * given. Doing so is far more secure as the parser will + * only process data coming from the document entity by +@@ -2605,6 +2605,9 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && + ((ctxt->options & XML_PARSE_NOENT) == 0) && + ((ctxt->options & XML_PARSE_DTDVALID) == 0) && ++ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) && ++ ((ctxt->options & XML_PARSE_DTDATTR) == 0) && ++ (ctxt->replaceEntities == 0) && + (ctxt->validate == 0)) + return; + +@@ -12609,6 +12612,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, + return(NULL); + } + ++ /* We are loading a DTD */ ++ ctxt->options |= XML_PARSE_DTDLOAD; ++ + /* + * Set-up the SAX context + */ +@@ -12736,6 +12742,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, + return(NULL); + } + ++ /* We are loading a DTD */ ++ ctxt->options |= XML_PARSE_DTDLOAD; ++ + /* + * Set-up the SAX context + */ diff --git a/debian/patches/series b/debian/patches/series index 4dae346..4ea5bbe 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,5 +4,28 @@ 0004-xmllint-memory-should-fail-on-empty-files.patch 0005-properly-quote-the-namespace-uris-written-out-during.patch 0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch -0007-Fix-XPath-optimization-with-predicates.patch -0008-xmllint-pretty-crashed-without-following-numeric-arg.patch +0007-missing-else-in-xlink.c.patch +0008-Catch-malloc-error-and-exit-accordingly.patch +0009-Fix-handling-of-mmap-errors.patch +0010-Avoid-crash-if-allocation-fails.patch +0011-Fix-a-possible-NULL-dereference.patch +0012-Clear-up-a-potential-NULL-dereference.patch +0013-Fix-XPath-optimization-with-predicates.patch +0014-xmllint-pretty-crashed-without-following-numeric-arg.patch +0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch +0016-Fix-a-potential-NULL-dereference-in-tree-code.patch +0017-Fix-pointer-dereferenced-before-null-check.patch +0018-Fix-a-bug-loading-some-compressed-files.patch +0019-Avoid-a-possibility-of-dangling-encoding-handler.patch +0020-Fix-a-couple-of-missing-NULL-checks.patch +0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch +0022-Handling-of-XPath-function-arguments-in-error-case.patch +0023-Missing-initialization-for-the-catalog-module.patch +0024-Fix-an-fd-leak-in-an-error-case.patch +0025-fixing-a-ptotential-uninitialized-access.patch +0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch +0027-Avoid-a-possible-NULL-pointer-dereference.patch +0028-Do-not-fetch-external-parameter-entities.patch +0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch +0030-xmllint-was-not-parsing-the-c14n11-flag.patch +0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch -- cgit v1.2.3 From 9e4ad7c5e2be5d7fb6cc47e76a5d149080bec214 Mon Sep 17 00:00:00 2001 From: Adam Conrad Date: Wed, 9 Jul 2014 05:19:17 +0800 Subject: Actually run dh_autoreconf, which the old/new mixed rules file misses. --- debian/rules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 9faf17d..bb6aa8a 100755 --- a/debian/rules +++ b/debian/rules @@ -36,7 +36,10 @@ CONFIGURE_FLAGS := --disable-silent-rules --with-history CC="$(CC)" CFLAGS="$(CF override_dh_auto_configure: $(TARGETS:%=doconfigure-%) -doconfigure-%: +debian/autoreconf.after: + dh_autoreconf + +doconfigure-%: debian/autoreconf.after dh_auto_configure --builddirectory=builddir/$* -- $(CONFIGURE_FLAGS) doconfigure-main: CONFIGURE_FLAGS += --without-python -- cgit v1.2.3 From 804887248d463ea955e09dea00b603dfd3269ff0 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 05:26:21 +0800 Subject: Call prename with -vf --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index bb6aa8a..dcd4905 100755 --- a/debian/rules +++ b/debian/rules @@ -92,7 +92,7 @@ doinstall-main: doinstall-python%-dbg: $(MAKE) -C builddir/main/python$*-dbg DESTDIR=$(CURDIR)/debian/tmp-dbg install-pythonLTLIBRARIES - prename 's/(? Date: Wed, 9 Jul 2014 05:34:06 +0800 Subject: Allow the package to cross-build by tweaking B-Ds on python --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index bd4ef20..c87539d 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,8 @@ Maintainer: Debian XML/SGML Group Uploaders: Aron Xu , YunQiang Su Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, - python-all-dev (>= 2.6.6-3~), python-all-dbg, + libpython-all-dev (>= 2.6.6-3~), libpython-all-dbg, + python-all-dev:any (>= 2.6.6-3~), python-all-dbg:any, zlib1g-dev | libz-dev, liblzma-dev Homepage: http://xmlsoft.org/ Vcs-Git: git://anonscm.debian.org/debian-xml-sgml/libxml2.git -- cgit v1.2.3 From f4286a98ba043cf61da3f246924e794ddcb6e255 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 06:17:08 +0800 Subject: Require python-all-dev (>= 2.7.5-5~) python 2.7.5-5 is the first version that sets "Multi-Arch: allowed", which makes cross-build possible. --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index c87539d..6281e14 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Debian XML/SGML Group Uploaders: Aron Xu , YunQiang Su Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, - libpython-all-dev (>= 2.6.6-3~), libpython-all-dbg, - python-all-dev:any (>= 2.6.6-3~), python-all-dbg:any, + libpython-all-dev, libpython-all-dbg, + python-all-dev:any (>= 2.7.5-5~), python-all-dbg:any, zlib1g-dev | libz-dev, liblzma-dev Homepage: http://xmlsoft.org/ Vcs-Git: git://anonscm.debian.org/debian-xml-sgml/libxml2.git -- cgit v1.2.3 From 31231ea4641af8a1c69fad7ef16386456d2be29b Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 9 Jul 2014 05:31:47 +0800 Subject: Add patch to fix python multiarch issue --- .../0002-Fix-an-error-in-xmlCleanupParser.patch | 27 ---- .../0002-fix-python-multiarch-includes.patch | 35 +++++ .../0003-Fix-an-error-in-xmlCleanupParser.patch | 27 ++++ ...ing-break-on-last-function-for-attributes.patch | 21 --- ...ing-break-on-last-function-for-attributes.patch | 21 +++ ...xmllint-memory-should-fail-on-empty-files.patch | 27 ---- ...ote-the-namespace-uris-written-out-during.patch | 32 ----- ...xmllint-memory-should-fail-on-empty-files.patch | 27 ++++ ...ng-bug-on-non-ascii-element-and-CR-LF-usa.patch | 57 -------- ...ote-the-namespace-uris-written-out-during.patch | 32 +++++ ...ng-bug-on-non-ascii-element-and-CR-LF-usa.patch | 57 ++++++++ debian/patches/0007-missing-else-in-xlink.c.patch | 22 --- ...8-Catch-malloc-error-and-exit-accordingly.patch | 24 ---- debian/patches/0008-missing-else-in-xlink.c.patch | 22 +++ ...9-Catch-malloc-error-and-exit-accordingly.patch | 24 ++++ .../patches/0009-Fix-handling-of-mmap-errors.patch | 51 ------- .../0010-Avoid-crash-if-allocation-fails.patch | 25 ---- .../patches/0010-Fix-handling-of-mmap-errors.patch | 51 +++++++ .../0011-Avoid-crash-if-allocation-fails.patch | 25 ++++ .../0011-Fix-a-possible-NULL-dereference.patch | 30 ----- ...012-Clear-up-a-potential-NULL-dereference.patch | 26 ---- .../0012-Fix-a-possible-NULL-dereference.patch | 30 +++++ ...013-Clear-up-a-potential-NULL-dereference.patch | 26 ++++ ...13-Fix-XPath-optimization-with-predicates.patch | 27 ---- ...14-Fix-XPath-optimization-with-predicates.patch | 27 ++++ ...tty-crashed-without-following-numeric-arg.patch | 34 ----- ...al-NULL-pointer-dereferences-in-regexp-co.patch | 45 ------- ...tty-crashed-without-following-numeric-arg.patch | 34 +++++ ...a-potential-NULL-dereference-in-tree-code.patch | 26 ---- ...al-NULL-pointer-dereferences-in-regexp-co.patch | 45 +++++++ ...a-potential-NULL-dereference-in-tree-code.patch | 26 ++++ ...ix-pointer-dereferenced-before-null-check.patch | 25 ---- ...8-Fix-a-bug-loading-some-compressed-files.patch | 69 ---------- ...ix-pointer-dereferenced-before-null-check.patch | 25 ++++ ...-possibility-of-dangling-encoding-handler.patch | 57 -------- ...9-Fix-a-bug-loading-some-compressed-files.patch | 69 ++++++++++ ...-possibility-of-dangling-encoding-handler.patch | 57 ++++++++ .../0020-Fix-a-couple-of-missing-NULL-checks.patch | 29 ---- .../0021-Fix-a-couple-of-missing-NULL-checks.patch | 29 ++++ ...-calls-to-xml-and-html-Read-parsing-entry.patch | 148 --------------------- ...of-XPath-function-arguments-in-error-case.patch | 41 ------ ...-calls-to-xml-and-html-Read-parsing-entry.patch | 148 +++++++++++++++++++++ ...of-XPath-function-arguments-in-error-case.patch | 41 ++++++ ...ing-initialization-for-the-catalog-module.patch | 22 --- .../0024-Fix-an-fd-leak-in-an-error-case.patch | 24 ---- ...ing-initialization-for-the-catalog-module.patch | 22 +++ .../0025-Fix-an-fd-leak-in-an-error-case.patch | 24 ++++ ...-fixing-a-ptotential-uninitialized-access.patch | 21 --- ...WriterWriteElement-when-a-null-content-is.patch | 29 ---- ...-fixing-a-ptotential-uninitialized-access.patch | 21 +++ ...Avoid-a-possible-NULL-pointer-dereference.patch | 22 --- ...WriterWriteElement-when-a-null-content-is.patch | 29 ++++ ...Avoid-a-possible-NULL-pointer-dereference.patch | 22 +++ ...-Do-not-fetch-external-parameter-entities.patch | 35 ----- ...ble-null-pointer-dereference-in-memory-de.patch | 32 ----- ...-Do-not-fetch-external-parameter-entities.patch | 35 +++++ ...ble-null-pointer-dereference-in-memory-de.patch | 32 +++++ ...0-xmllint-was-not-parsing-the-c14n11-flag.patch | 22 --- ...essions-introduced-by-CVE-2014-0191-patch.patch | 58 -------- ...1-xmllint-was-not-parsing-the-c14n11-flag.patch | 22 +++ ...essions-introduced-by-CVE-2014-0191-patch.patch | 58 ++++++++ debian/patches/series | 61 ++++----- 62 files changed, 1174 insertions(+), 1138 deletions(-) delete mode 100644 debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch create mode 100644 debian/patches/0002-fix-python-multiarch-includes.patch create mode 100644 debian/patches/0003-Fix-an-error-in-xmlCleanupParser.patch delete mode 100644 debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch create mode 100644 debian/patches/0004-Fix-missing-break-on-last-function-for-attributes.patch delete mode 100644 debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch delete mode 100644 debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch create mode 100644 debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch delete mode 100644 debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch create mode 100644 debian/patches/0006-properly-quote-the-namespace-uris-written-out-during.patch create mode 100644 debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch delete mode 100644 debian/patches/0007-missing-else-in-xlink.c.patch delete mode 100644 debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch create mode 100644 debian/patches/0008-missing-else-in-xlink.c.patch create mode 100644 debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch delete mode 100644 debian/patches/0009-Fix-handling-of-mmap-errors.patch delete mode 100644 debian/patches/0010-Avoid-crash-if-allocation-fails.patch create mode 100644 debian/patches/0010-Fix-handling-of-mmap-errors.patch create mode 100644 debian/patches/0011-Avoid-crash-if-allocation-fails.patch delete mode 100644 debian/patches/0011-Fix-a-possible-NULL-dereference.patch delete mode 100644 debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch create mode 100644 debian/patches/0012-Fix-a-possible-NULL-dereference.patch create mode 100644 debian/patches/0013-Clear-up-a-potential-NULL-dereference.patch delete mode 100644 debian/patches/0013-Fix-XPath-optimization-with-predicates.patch create mode 100644 debian/patches/0014-Fix-XPath-optimization-with-predicates.patch delete mode 100644 debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch delete mode 100644 debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch create mode 100644 debian/patches/0015-xmllint-pretty-crashed-without-following-numeric-arg.patch delete mode 100644 debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch create mode 100644 debian/patches/0016-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch create mode 100644 debian/patches/0017-Fix-a-potential-NULL-dereference-in-tree-code.patch delete mode 100644 debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch delete mode 100644 debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch create mode 100644 debian/patches/0018-Fix-pointer-dereferenced-before-null-check.patch delete mode 100644 debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch create mode 100644 debian/patches/0019-Fix-a-bug-loading-some-compressed-files.patch create mode 100644 debian/patches/0020-Avoid-a-possibility-of-dangling-encoding-handler.patch delete mode 100644 debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch create mode 100644 debian/patches/0021-Fix-a-couple-of-missing-NULL-checks.patch delete mode 100644 debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch delete mode 100644 debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch create mode 100644 debian/patches/0022-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch create mode 100644 debian/patches/0023-Handling-of-XPath-function-arguments-in-error-case.patch delete mode 100644 debian/patches/0023-Missing-initialization-for-the-catalog-module.patch delete mode 100644 debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch create mode 100644 debian/patches/0024-Missing-initialization-for-the-catalog-module.patch create mode 100644 debian/patches/0025-Fix-an-fd-leak-in-an-error-case.patch delete mode 100644 debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch delete mode 100644 debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch create mode 100644 debian/patches/0026-fixing-a-ptotential-uninitialized-access.patch delete mode 100644 debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch create mode 100644 debian/patches/0027-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch create mode 100644 debian/patches/0028-Avoid-a-possible-NULL-pointer-dereference.patch delete mode 100644 debian/patches/0028-Do-not-fetch-external-parameter-entities.patch delete mode 100644 debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch create mode 100644 debian/patches/0029-Do-not-fetch-external-parameter-entities.patch create mode 100644 debian/patches/0030-Avoid-Possible-null-pointer-dereference-in-memory-de.patch delete mode 100644 debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch delete mode 100644 debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch create mode 100644 debian/patches/0031-xmllint-was-not-parsing-the-c14n11-flag.patch create mode 100644 debian/patches/0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch (limited to 'debian') diff --git a/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch b/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch deleted file mode 100644 index 03bf447..0000000 --- a/debian/patches/0002-Fix-an-error-in-xmlCleanupParser.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Alexander Pastukhov -Date: Tue, 23 Apr 2013 05:02:11 +0000 -Subject: Fix an error in xmlCleanupParser - -https://bugzilla.gnome.org/show_bug.cgi?id=698582 - -xmlCleanupParser calls xmlCleanupGlobals() and then -xmlResetLastError() but the later reallocate the global -data freed by previous call. Just swap the two calls. ---- - parser.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/parser.c b/parser.c -index ee429f3..b9df6d8 100644 ---- a/parser.c -+++ b/parser.c -@@ -14763,8 +14763,8 @@ xmlCleanupParser(void) { - xmlSchemaCleanupTypes(); - xmlRelaxNGCleanupTypes(); - #endif -- xmlCleanupGlobals(); - xmlResetLastError(); -+ xmlCleanupGlobals(); - xmlCleanupThreads(); /* must be last if called not from the main thread */ - xmlCleanupMemory(); - xmlParserInitialized = 0; diff --git a/debian/patches/0002-fix-python-multiarch-includes.patch b/debian/patches/0002-fix-python-multiarch-includes.patch new file mode 100644 index 0000000..ff7c4fa --- /dev/null +++ b/debian/patches/0002-fix-python-multiarch-includes.patch @@ -0,0 +1,35 @@ +From: Matthias Klose +Date: Wed, 9 Jul 2014 05:30:24 +0800 +Subject: fix python multiarch includes + +--- + python/Makefile.am | 2 +- + python/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python/Makefile.am b/python/Makefile.am +index 34aed96..8445ea5 100644 +--- a/python/Makefile.am ++++ b/python/Makefile.am +@@ -19,7 +19,7 @@ if WITH_PYTHON + AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ +- -I$(PYTHON_INCLUDES) ++ $(PYTHON_INCLUDES) + + python_LTLIBRARIES = libxml2mod.la + +diff --git a/python/Makefile.in b/python/Makefile.in +index efdea43..23e7fa2 100644 +--- a/python/Makefile.in ++++ b/python/Makefile.in +@@ -430,7 +430,7 @@ EXTRA_DIST = \ + @WITH_PYTHON_TRUE@AM_CPPFLAGS = \ + @WITH_PYTHON_TRUE@ -I$(top_builddir)/include \ + @WITH_PYTHON_TRUE@ -I$(top_srcdir)/include \ +-@WITH_PYTHON_TRUE@ -I$(PYTHON_INCLUDES) ++@WITH_PYTHON_TRUE@ $(PYTHON_INCLUDES) + + @WITH_PYTHON_TRUE@python_LTLIBRARIES = libxml2mod.la + @WITH_PYTHON_TRUE@libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c diff --git a/debian/patches/0003-Fix-an-error-in-xmlCleanupParser.patch b/debian/patches/0003-Fix-an-error-in-xmlCleanupParser.patch new file mode 100644 index 0000000..03bf447 --- /dev/null +++ b/debian/patches/0003-Fix-an-error-in-xmlCleanupParser.patch @@ -0,0 +1,27 @@ +From: Alexander Pastukhov +Date: Tue, 23 Apr 2013 05:02:11 +0000 +Subject: Fix an error in xmlCleanupParser + +https://bugzilla.gnome.org/show_bug.cgi?id=698582 + +xmlCleanupParser calls xmlCleanupGlobals() and then +xmlResetLastError() but the later reallocate the global +data freed by previous call. Just swap the two calls. +--- + parser.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index ee429f3..b9df6d8 100644 +--- a/parser.c ++++ b/parser.c +@@ -14763,8 +14763,8 @@ xmlCleanupParser(void) { + xmlSchemaCleanupTypes(); + xmlRelaxNGCleanupTypes(); + #endif +- xmlCleanupGlobals(); + xmlResetLastError(); ++ xmlCleanupGlobals(); + xmlCleanupThreads(); /* must be last if called not from the main thread */ + xmlCleanupMemory(); + xmlParserInitialized = 0; diff --git a/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch b/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch deleted file mode 100644 index cff8b72..0000000 --- a/debian/patches/0003-Fix-missing-break-on-last-function-for-attributes.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: dcb -Date: Thu, 2 May 2013 08:11:46 +0000 -Subject: Fix missing break on last() function for attributes - -pointed out by cppcheck ---- - python/libxml.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/python/libxml.c b/python/libxml.c -index 03cfb9f..3338b83 100644 ---- a/python/libxml.c -+++ b/python/libxml.c -@@ -2683,6 +2683,7 @@ libxml_last(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) - xmlAttrPtr attr = (xmlAttrPtr) cur; - - res = attr->last; -+ break; - } - default: - res = NULL; diff --git a/debian/patches/0004-Fix-missing-break-on-last-function-for-attributes.patch b/debian/patches/0004-Fix-missing-break-on-last-function-for-attributes.patch new file mode 100644 index 0000000..cff8b72 --- /dev/null +++ b/debian/patches/0004-Fix-missing-break-on-last-function-for-attributes.patch @@ -0,0 +1,21 @@ +From: dcb +Date: Thu, 2 May 2013 08:11:46 +0000 +Subject: Fix missing break on last() function for attributes + +pointed out by cppcheck +--- + python/libxml.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/python/libxml.c b/python/libxml.c +index 03cfb9f..3338b83 100644 +--- a/python/libxml.c ++++ b/python/libxml.c +@@ -2683,6 +2683,7 @@ libxml_last(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) + xmlAttrPtr attr = (xmlAttrPtr) cur; + + res = attr->last; ++ break; + } + default: + res = NULL; diff --git a/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch b/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch deleted file mode 100644 index e1a2197..0000000 --- a/debian/patches/0004-xmllint-memory-should-fail-on-empty-files.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Daniel Veillard -Date: Wed, 8 May 2013 05:45:48 +0000 -Subject: xmllint --memory should fail on empty files - -Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896 -when doing analysis but a priori unrelated. ---- - xmllint.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/xmllint.c b/xmllint.c -index 26d8db1..c0196ab 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { - if ((fd = open(filename, O_RDONLY)) < 0) - return; - base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; -- if (base == (void *) MAP_FAILED) -+ if (base == (void *) MAP_FAILED) { -+ fprintf(stderr, "mmap failure for file %s\n", filename); -+ progresult = XMLLINT_ERR_RDFILE; - return; -+ } - - if (rectxt == NULL) - doc = xmlReadMemory((char *) base, info.st_size, diff --git a/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch b/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch deleted file mode 100644 index 6f4c4c8..0000000 --- a/debian/patches/0005-properly-quote-the-namespace-uris-written-out-during.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Aleksey Sanin -Date: Thu, 9 May 2013 16:02:16 +0000 -Subject: properly quote the namespace uris written out during c14n - ---- - c14n.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/c14n.c b/c14n.c -index afd95b3..ca77f92 100644 ---- a/c14n.c -+++ b/c14n.c -@@ -547,14 +547,15 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx) - if (ns->prefix != NULL) { - xmlOutputBufferWriteString(ctx->buf, " xmlns:"); - xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix); -- xmlOutputBufferWriteString(ctx->buf, "=\""); -+ xmlOutputBufferWriteString(ctx->buf, "="); - } else { -- xmlOutputBufferWriteString(ctx->buf, " xmlns=\""); -+ xmlOutputBufferWriteString(ctx->buf, " xmlns="); - } - if(ns->href != NULL) { -- xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href); -+ xmlBufWriteQuotedString(ctx->buf->buffer, ns->href); -+ } else { -+ xmlOutputBufferWriteString(ctx->buf, "\"\""); - } -- xmlOutputBufferWriteString(ctx->buf, "\""); - return (1); - } - diff --git a/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch b/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch new file mode 100644 index 0000000..e1a2197 --- /dev/null +++ b/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch @@ -0,0 +1,27 @@ +From: Daniel Veillard +Date: Wed, 8 May 2013 05:45:48 +0000 +Subject: xmllint --memory should fail on empty files + +Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896 +when doing analysis but a priori unrelated. +--- + xmllint.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/xmllint.c b/xmllint.c +index 26d8db1..c0196ab 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + if (rectxt == NULL) + doc = xmlReadMemory((char *) base, info.st_size, diff --git a/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch b/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch deleted file mode 100644 index 442fd11..0000000 --- a/debian/patches/0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Daniel Veillard -Date: Wed, 22 May 2013 20:56:45 +0000 -Subject: Fix a parsing bug on non-ascii element and CR/LF usage - -https://bugzilla.gnome.org/show_bug.cgi?id=698550 - -Somehow the behaviour of the internal parser routine changed -slightly when encountering CR/LF, which led to a bug when -parsing document with non-ascii Names ---- - parser.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/parser.c b/parser.c -index b9df6d8..dd00399 100644 ---- a/parser.c -+++ b/parser.c -@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { - int len = 0, l; - int c; - int count = 0; -+ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */ - - #ifdef DEBUG - nbParseNCNameComplex++; -@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { - * Handler for more complex cases - */ - GROW; -+ end = ctxt->input->cur; - c = CUR_CHAR(l); - if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ - (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { -@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { - } - len += l; - NEXTL(l); -+ end = ctxt->input->cur; - c = CUR_CHAR(l); - if (c == 0) { - count = 0; - GROW; - if (ctxt->instate == XML_PARSER_EOF) - return(NULL); -+ end = ctxt->input->cur; - c = CUR_CHAR(l); - } - } -@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); - return(NULL); - } -- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); -+ return(xmlDictLookup(ctxt->dict, end - len, len)); - } - - /** diff --git a/debian/patches/0006-properly-quote-the-namespace-uris-written-out-during.patch b/debian/patches/0006-properly-quote-the-namespace-uris-written-out-during.patch new file mode 100644 index 0000000..6f4c4c8 --- /dev/null +++ b/debian/patches/0006-properly-quote-the-namespace-uris-written-out-during.patch @@ -0,0 +1,32 @@ +From: Aleksey Sanin +Date: Thu, 9 May 2013 16:02:16 +0000 +Subject: properly quote the namespace uris written out during c14n + +--- + c14n.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/c14n.c b/c14n.c +index afd95b3..ca77f92 100644 +--- a/c14n.c ++++ b/c14n.c +@@ -547,14 +547,15 @@ xmlC14NPrintNamespaces(const xmlNsPtr ns, xmlC14NCtxPtr ctx) + if (ns->prefix != NULL) { + xmlOutputBufferWriteString(ctx->buf, " xmlns:"); + xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix); +- xmlOutputBufferWriteString(ctx->buf, "=\""); ++ xmlOutputBufferWriteString(ctx->buf, "="); + } else { +- xmlOutputBufferWriteString(ctx->buf, " xmlns=\""); ++ xmlOutputBufferWriteString(ctx->buf, " xmlns="); + } + if(ns->href != NULL) { +- xmlOutputBufferWriteString(ctx->buf, (const char *) ns->href); ++ xmlBufWriteQuotedString(ctx->buf->buffer, ns->href); ++ } else { ++ xmlOutputBufferWriteString(ctx->buf, "\"\""); + } +- xmlOutputBufferWriteString(ctx->buf, "\""); + return (1); + } + diff --git a/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch b/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch new file mode 100644 index 0000000..442fd11 --- /dev/null +++ b/debian/patches/0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch @@ -0,0 +1,57 @@ +From: Daniel Veillard +Date: Wed, 22 May 2013 20:56:45 +0000 +Subject: Fix a parsing bug on non-ascii element and CR/LF usage + +https://bugzilla.gnome.org/show_bug.cgi?id=698550 + +Somehow the behaviour of the internal parser routine changed +slightly when encountering CR/LF, which led to a bug when +parsing document with non-ascii Names +--- + parser.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/parser.c b/parser.c +index b9df6d8..dd00399 100644 +--- a/parser.c ++++ b/parser.c +@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + int len = 0, l; + int c; + int count = 0; ++ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */ + + #ifdef DEBUG + nbParseNCNameComplex++; +@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + * Handler for more complex cases + */ + GROW; ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ + (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { +@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + } + len += l; + NEXTL(l); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + } + } +@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } +- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); ++ return(xmlDictLookup(ctxt->dict, end - len, len)); + } + + /** diff --git a/debian/patches/0007-missing-else-in-xlink.c.patch b/debian/patches/0007-missing-else-in-xlink.c.patch deleted file mode 100644 index 88a4e86..0000000 --- a/debian/patches/0007-missing-else-in-xlink.c.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Ami Fischman -Date: Tue, 2 Jul 2013 09:47:26 +0800 -Subject: missing else in xlink.c - -Obviously forgotten ---- - xlink.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xlink.c b/xlink.c -index 3566e06..c0e4ff3 100644 ---- a/xlink.c -+++ b/xlink.c -@@ -150,7 +150,7 @@ xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { - if (type != NULL) { - if (xmlStrEqual(type, BAD_CAST "simple")) { - ret = XLINK_TYPE_SIMPLE; -- } if (xmlStrEqual(type, BAD_CAST "extended")) { -+ } else if (xmlStrEqual(type, BAD_CAST "extended")) { - role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE); - if (role != NULL) { - xmlNsPtr xlink; diff --git a/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch b/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch deleted file mode 100644 index 3f93a57..0000000 --- a/debian/patches/0008-Catch-malloc-error-and-exit-accordingly.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Daniel Veillard -Date: Thu, 11 Jul 2013 15:41:22 +0800 -Subject: Catch malloc error and exit accordingly - -As pointed privately by Bill Parker ---- - xmllint.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/xmllint.c b/xmllint.c -index c0196ab..4d464e4 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -3090,6 +3090,10 @@ static void usage(const char *name) { - static void registerNode(xmlNodePtr node) - { - node->_private = malloc(sizeof(long)); -+ if (node->_private == NULL) { -+ fprintf(stderr, "Out of memory in xmllint:registerNode()\n"); -+ exit(XMLLINT_ERR_MEM); -+ } - *(long*)node->_private = (long) 0x81726354; - nbregister++; - } diff --git a/debian/patches/0008-missing-else-in-xlink.c.patch b/debian/patches/0008-missing-else-in-xlink.c.patch new file mode 100644 index 0000000..88a4e86 --- /dev/null +++ b/debian/patches/0008-missing-else-in-xlink.c.patch @@ -0,0 +1,22 @@ +From: Ami Fischman +Date: Tue, 2 Jul 2013 09:47:26 +0800 +Subject: missing else in xlink.c + +Obviously forgotten +--- + xlink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xlink.c b/xlink.c +index 3566e06..c0e4ff3 100644 +--- a/xlink.c ++++ b/xlink.c +@@ -150,7 +150,7 @@ xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) { + if (type != NULL) { + if (xmlStrEqual(type, BAD_CAST "simple")) { + ret = XLINK_TYPE_SIMPLE; +- } if (xmlStrEqual(type, BAD_CAST "extended")) { ++ } else if (xmlStrEqual(type, BAD_CAST "extended")) { + role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE); + if (role != NULL) { + xmlNsPtr xlink; diff --git a/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch b/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch new file mode 100644 index 0000000..3f93a57 --- /dev/null +++ b/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch @@ -0,0 +1,24 @@ +From: Daniel Veillard +Date: Thu, 11 Jul 2013 15:41:22 +0800 +Subject: Catch malloc error and exit accordingly + +As pointed privately by Bill Parker +--- + xmllint.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xmllint.c b/xmllint.c +index c0196ab..4d464e4 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -3090,6 +3090,10 @@ static void usage(const char *name) { + static void registerNode(xmlNodePtr node) + { + node->_private = malloc(sizeof(long)); ++ if (node->_private == NULL) { ++ fprintf(stderr, "Out of memory in xmllint:registerNode()\n"); ++ exit(XMLLINT_ERR_MEM); ++ } + *(long*)node->_private = (long) 0x81726354; + nbregister++; + } diff --git a/debian/patches/0009-Fix-handling-of-mmap-errors.patch b/debian/patches/0009-Fix-handling-of-mmap-errors.patch deleted file mode 100644 index 0c55cfe..0000000 --- a/debian/patches/0009-Fix-handling-of-mmap-errors.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Daniel Veillard -Date: Fri, 12 Jul 2013 12:08:40 +0800 -Subject: Fix handling of mmap errors - -https://bugzilla.gnome.org/show_bug.cgi?id=702320 - -as raised by Gaurav ---- - xmllint.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/xmllint.c b/xmllint.c -index 4d464e4..92e6b03 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -1837,8 +1837,12 @@ static void streamFile(char *filename) { - if ((fd = open(filename, O_RDONLY)) < 0) - return; - base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; -- if (base == (void *) MAP_FAILED) -+ if (base == (void *) MAP_FAILED) { -+ close(fd); -+ fprintf(stderr, "mmap failure for file %s\n", filename); -+ progresult = XMLLINT_ERR_RDFILE; - return; -+ } - - reader = xmlReaderForMemory(base, info.st_size, filename, - NULL, options); -@@ -2223,8 +2227,12 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { - if ((fd = open(filename, O_RDONLY)) < 0) - return; - base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; -- if (base == (void *) MAP_FAILED) -+ if (base == (void *) MAP_FAILED) { -+ close(fd); -+ fprintf(stderr, "mmap failure for file %s\n", filename); -+ progresult = XMLLINT_ERR_RDFILE; - return; -+ } - - doc = htmlReadMemory((char *) base, info.st_size, filename, - NULL, options); -@@ -2339,6 +2347,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { - return; - base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; - if (base == (void *) MAP_FAILED) { -+ close(fd); - fprintf(stderr, "mmap failure for file %s\n", filename); - progresult = XMLLINT_ERR_RDFILE; - return; diff --git a/debian/patches/0010-Avoid-crash-if-allocation-fails.patch b/debian/patches/0010-Avoid-crash-if-allocation-fails.patch deleted file mode 100644 index e4e7206..0000000 --- a/debian/patches/0010-Avoid-crash-if-allocation-fails.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Daniel Veillard -Date: Mon, 22 Jul 2013 14:28:20 +0800 -Subject: Avoid crash if allocation fails - -https://bugzilla.gnome.org/show_bug.cgi?id=704527 -xmlSchemaNewValue() may fail on OOM error ---- - xmlschemastypes.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/xmlschemastypes.c b/xmlschemastypes.c -index a9edc03..ec403e8 100644 ---- a/xmlschemastypes.c -+++ b/xmlschemastypes.c -@@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value) - } - ret->type = XML_SCHEMA_FACET_MINLENGTH; - ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER); -+ if (ret->val == NULL) { -+ xmlFree(ret); -+ return(NULL); -+ } - ret->val->value.decimal.lo = value; - return (ret); - } diff --git a/debian/patches/0010-Fix-handling-of-mmap-errors.patch b/debian/patches/0010-Fix-handling-of-mmap-errors.patch new file mode 100644 index 0000000..0c55cfe --- /dev/null +++ b/debian/patches/0010-Fix-handling-of-mmap-errors.patch @@ -0,0 +1,51 @@ +From: Daniel Veillard +Date: Fri, 12 Jul 2013 12:08:40 +0800 +Subject: Fix handling of mmap errors + +https://bugzilla.gnome.org/show_bug.cgi?id=702320 + +as raised by Gaurav +--- + xmllint.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/xmllint.c b/xmllint.c +index 4d464e4..92e6b03 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -1837,8 +1837,12 @@ static void streamFile(char *filename) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ close(fd); ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + reader = xmlReaderForMemory(base, info.st_size, filename, + NULL, options); +@@ -2223,8 +2227,12 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + if ((fd = open(filename, O_RDONLY)) < 0) + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; +- if (base == (void *) MAP_FAILED) ++ if (base == (void *) MAP_FAILED) { ++ close(fd); ++ fprintf(stderr, "mmap failure for file %s\n", filename); ++ progresult = XMLLINT_ERR_RDFILE; + return; ++ } + + doc = htmlReadMemory((char *) base, info.st_size, filename, + NULL, options); +@@ -2339,6 +2347,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + return; + base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ; + if (base == (void *) MAP_FAILED) { ++ close(fd); + fprintf(stderr, "mmap failure for file %s\n", filename); + progresult = XMLLINT_ERR_RDFILE; + return; diff --git a/debian/patches/0011-Avoid-crash-if-allocation-fails.patch b/debian/patches/0011-Avoid-crash-if-allocation-fails.patch new file mode 100644 index 0000000..e4e7206 --- /dev/null +++ b/debian/patches/0011-Avoid-crash-if-allocation-fails.patch @@ -0,0 +1,25 @@ +From: Daniel Veillard +Date: Mon, 22 Jul 2013 14:28:20 +0800 +Subject: Avoid crash if allocation fails + +https://bugzilla.gnome.org/show_bug.cgi?id=704527 +xmlSchemaNewValue() may fail on OOM error +--- + xmlschemastypes.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xmlschemastypes.c b/xmlschemastypes.c +index a9edc03..ec403e8 100644 +--- a/xmlschemastypes.c ++++ b/xmlschemastypes.c +@@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value) + } + ret->type = XML_SCHEMA_FACET_MINLENGTH; + ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER); ++ if (ret->val == NULL) { ++ xmlFree(ret); ++ return(NULL); ++ } + ret->val->value.decimal.lo = value; + return (ret); + } diff --git a/debian/patches/0011-Fix-a-possible-NULL-dereference.patch b/debian/patches/0011-Fix-a-possible-NULL-dereference.patch deleted file mode 100644 index 9a7cf6f..0000000 --- a/debian/patches/0011-Fix-a-possible-NULL-dereference.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Gaurav -Date: Sat, 3 Aug 2013 22:16:02 +0800 -Subject: Fix a possible NULL dereference - -https://bugzilla.gnome.org/show_bug.cgi?id=705400 -In case of allocation error the pointer was dereferenced before the -test for a failure ---- - SAX2.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/SAX2.c b/SAX2.c -index 4adf202..33d167e 100644 ---- a/SAX2.c -+++ b/SAX2.c -@@ -994,12 +994,12 @@ xmlSAX2StartDocument(void *ctx) - #ifdef LIBXML_HTML_ENABLED - if (ctxt->myDoc == NULL) - ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); -- ctxt->myDoc->properties = XML_DOC_HTML; -- ctxt->myDoc->parseFlags = ctxt->options; - if (ctxt->myDoc == NULL) { - xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument"); - return; - } -+ ctxt->myDoc->properties = XML_DOC_HTML; -+ ctxt->myDoc->parseFlags = ctxt->options; - #else - xmlGenericError(xmlGenericErrorContext, - "libxml2 built without HTML support\n"); diff --git a/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch b/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch deleted file mode 100644 index a18dfaf..0000000 --- a/debian/patches/0012-Clear-up-a-potential-NULL-dereference.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Daniel Veillard -Date: Sat, 3 Aug 2013 22:25:13 +0800 -Subject: Clear up a potential NULL dereference - -https://bugzilla.gnome.org/show_bug.cgi?id=705399 - -if ctxt->node_seq.buffer is null then ctxt->node_seq.maximum ought -to be zero but it's better to clarify the check in the code directly. ---- - parserInternals.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/parserInternals.c b/parserInternals.c -index f8a7041..98a5836 100644 ---- a/parserInternals.c -+++ b/parserInternals.c -@@ -1990,7 +1990,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, - - /* Otherwise, we need to add new node to buffer */ - else { -- if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) { -+ if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) || -+ (ctxt->node_seq.buffer == NULL)) { - xmlParserNodeInfo *tmp_buffer; - unsigned int byte_size; - diff --git a/debian/patches/0012-Fix-a-possible-NULL-dereference.patch b/debian/patches/0012-Fix-a-possible-NULL-dereference.patch new file mode 100644 index 0000000..9a7cf6f --- /dev/null +++ b/debian/patches/0012-Fix-a-possible-NULL-dereference.patch @@ -0,0 +1,30 @@ +From: Gaurav +Date: Sat, 3 Aug 2013 22:16:02 +0800 +Subject: Fix a possible NULL dereference + +https://bugzilla.gnome.org/show_bug.cgi?id=705400 +In case of allocation error the pointer was dereferenced before the +test for a failure +--- + SAX2.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/SAX2.c b/SAX2.c +index 4adf202..33d167e 100644 +--- a/SAX2.c ++++ b/SAX2.c +@@ -994,12 +994,12 @@ xmlSAX2StartDocument(void *ctx) + #ifdef LIBXML_HTML_ENABLED + if (ctxt->myDoc == NULL) + ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL); +- ctxt->myDoc->properties = XML_DOC_HTML; +- ctxt->myDoc->parseFlags = ctxt->options; + if (ctxt->myDoc == NULL) { + xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument"); + return; + } ++ ctxt->myDoc->properties = XML_DOC_HTML; ++ ctxt->myDoc->parseFlags = ctxt->options; + #else + xmlGenericError(xmlGenericErrorContext, + "libxml2 built without HTML support\n"); diff --git a/debian/patches/0013-Clear-up-a-potential-NULL-dereference.patch b/debian/patches/0013-Clear-up-a-potential-NULL-dereference.patch new file mode 100644 index 0000000..a18dfaf --- /dev/null +++ b/debian/patches/0013-Clear-up-a-potential-NULL-dereference.patch @@ -0,0 +1,26 @@ +From: Daniel Veillard +Date: Sat, 3 Aug 2013 22:25:13 +0800 +Subject: Clear up a potential NULL dereference + +https://bugzilla.gnome.org/show_bug.cgi?id=705399 + +if ctxt->node_seq.buffer is null then ctxt->node_seq.maximum ought +to be zero but it's better to clarify the check in the code directly. +--- + parserInternals.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/parserInternals.c b/parserInternals.c +index f8a7041..98a5836 100644 +--- a/parserInternals.c ++++ b/parserInternals.c +@@ -1990,7 +1990,8 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, + + /* Otherwise, we need to add new node to buffer */ + else { +- if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) { ++ if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) || ++ (ctxt->node_seq.buffer == NULL)) { + xmlParserNodeInfo *tmp_buffer; + unsigned int byte_size; + diff --git a/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch deleted file mode 100644 index f24424a..0000000 --- a/debian/patches/0013-Fix-XPath-optimization-with-predicates.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Nick Wellnhofer -Date: Sun, 4 Aug 2013 22:15:11 +0000 -Subject: Fix XPath '//' optimization with predicates - -My attempt to optimize XPath expressions containing '//' caused a -regression reported in bug #695699. This commit disables the -optimization for expressions of the form '//foo[predicate]'. ---- - xpath.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/xpath.c b/xpath.c -index 97410e7..a676989 100644 ---- a/xpath.c -+++ b/xpath.c -@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) - * internal representation. - */ - -- if ((op->ch1 != -1) && -- (op->op == XPATH_OP_COLLECT /* 11 */)) -+ if ((op->op == XPATH_OP_COLLECT /* 11 */) && -+ (op->ch1 != -1) && -+ (op->ch2 == -1 /* no predicate */)) - { - xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; - diff --git a/debian/patches/0014-Fix-XPath-optimization-with-predicates.patch b/debian/patches/0014-Fix-XPath-optimization-with-predicates.patch new file mode 100644 index 0000000..f24424a --- /dev/null +++ b/debian/patches/0014-Fix-XPath-optimization-with-predicates.patch @@ -0,0 +1,27 @@ +From: Nick Wellnhofer +Date: Sun, 4 Aug 2013 22:15:11 +0000 +Subject: Fix XPath '//' optimization with predicates + +My attempt to optimize XPath expressions containing '//' caused a +regression reported in bug #695699. This commit disables the +optimization for expressions of the form '//foo[predicate]'. +--- + xpath.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xpath.c b/xpath.c +index 97410e7..a676989 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -14719,8 +14719,9 @@ xmlXPathOptimizeExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op) + * internal representation. + */ + +- if ((op->ch1 != -1) && +- (op->op == XPATH_OP_COLLECT /* 11 */)) ++ if ((op->op == XPATH_OP_COLLECT /* 11 */) && ++ (op->ch1 != -1) && ++ (op->ch2 == -1 /* no predicate */)) + { + xmlXPathStepOpPtr prevop = &comp->steps[op->ch1]; + diff --git a/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch deleted file mode 100644 index b910c3a..0000000 --- a/debian/patches/0014-xmllint-pretty-crashed-without-following-numeric-arg.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Tim Galeckas -Date: Thu, 29 Aug 2013 16:44:33 +0800 -Subject: xmllint --pretty crashed without following numeric argument - -https://bugzilla.gnome.org/show_bug.cgi?id=674789 - -We need to check for NULL argument before calling atoi() ---- - xmllint.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/xmllint.c b/xmllint.c -index 92e6b03..d69722c 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -3388,11 +3388,13 @@ main(int argc, char **argv) { - (!strcmp(argv[i], "--pretty"))) { - i++; - #ifdef LIBXML_OUTPUT_ENABLED -- format = atoi(argv[i]); -- if (format == 1) { -- noblanks++; -- xmlKeepBlanksDefault(0); -- } -+ if (argv[i] != NULL) { -+ format = atoi(argv[i]); -+ if (format == 1) { -+ noblanks++; -+ xmlKeepBlanksDefault(0); -+ } -+ } - #endif /* LIBXML_OUTPUT_ENABLED */ - } - #ifdef LIBXML_READER_ENABLED diff --git a/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch b/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch deleted file mode 100644 index fa8a176..0000000 --- a/debian/patches/0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Gaurav -Date: Wed, 11 Sep 2013 14:59:06 +0800 -Subject: Fix potential NULL pointer dereferences in regexp code - -https://bugzilla.gnome.org/show_bug.cgi?id=707749 - -Fix 3 cases where we might dereference NULL ---- - xmlregexp.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/xmlregexp.c b/xmlregexp.c -index 1f9911c..8e63d74 100644 ---- a/xmlregexp.c -+++ b/xmlregexp.c -@@ -3162,8 +3162,10 @@ xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) { - exec->status = -6; - return; - } -- memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, -+ if (exec->counts) { -+ memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, - exec->comp->nbCounters * sizeof(int)); -+ } - } - - #ifdef DEBUG_REGEXP_EXEC -@@ -4091,7 +4093,7 @@ rollback: - */ - exec->determinist = 0; - xmlFARegExecRollBack(exec); -- if (exec->status == 0) { -+ if ((exec->inputStack != NULL ) && (exec->status == 0)) { - value = exec->inputStack[exec->index].value; - data = exec->inputStack[exec->index].data; - #ifdef DEBUG_PUSH -@@ -4306,7 +4308,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, - (*nbval)++; - } - } else { -- if ((exec->comp->states[trans->to] != NULL) && -+ if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) && - (exec->comp->states[trans->to]->type != - XML_REGEXP_SINK_STATE)) { - if (atom->neg) diff --git a/debian/patches/0015-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0015-xmllint-pretty-crashed-without-following-numeric-arg.patch new file mode 100644 index 0000000..b910c3a --- /dev/null +++ b/debian/patches/0015-xmllint-pretty-crashed-without-following-numeric-arg.patch @@ -0,0 +1,34 @@ +From: Tim Galeckas +Date: Thu, 29 Aug 2013 16:44:33 +0800 +Subject: xmllint --pretty crashed without following numeric argument + +https://bugzilla.gnome.org/show_bug.cgi?id=674789 + +We need to check for NULL argument before calling atoi() +--- + xmllint.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/xmllint.c b/xmllint.c +index 92e6b03..d69722c 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -3388,11 +3388,13 @@ main(int argc, char **argv) { + (!strcmp(argv[i], "--pretty"))) { + i++; + #ifdef LIBXML_OUTPUT_ENABLED +- format = atoi(argv[i]); +- if (format == 1) { +- noblanks++; +- xmlKeepBlanksDefault(0); +- } ++ if (argv[i] != NULL) { ++ format = atoi(argv[i]); ++ if (format == 1) { ++ noblanks++; ++ xmlKeepBlanksDefault(0); ++ } ++ } + #endif /* LIBXML_OUTPUT_ENABLED */ + } + #ifdef LIBXML_READER_ENABLED diff --git a/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch b/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch deleted file mode 100644 index 2c55813..0000000 --- a/debian/patches/0016-Fix-a-potential-NULL-dereference-in-tree-code.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Daniel Veillard -Date: Wed, 11 Sep 2013 15:11:27 +0800 -Subject: Fix a potential NULL dereference in tree code - -https://bugzilla.gnome.org/show_bug.cgi?id=707750 - -Also reported by Gaurav, simple fix to check the pointer before -dereference ---- - tree.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tree.c b/tree.c -index 7e5af26..efc3ca2 100644 ---- a/tree.c -+++ b/tree.c -@@ -9780,7 +9780,8 @@ leave_node: - if (clone->parent != NULL) - clone->parent->last = clone; - clone = clone->parent; -- parentClone = clone->parent; -+ if (clone != NULL) -+ parentClone = clone->parent; - /* - * Process parent --> next; - */ diff --git a/debian/patches/0016-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch b/debian/patches/0016-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch new file mode 100644 index 0000000..fa8a176 --- /dev/null +++ b/debian/patches/0016-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch @@ -0,0 +1,45 @@ +From: Gaurav +Date: Wed, 11 Sep 2013 14:59:06 +0800 +Subject: Fix potential NULL pointer dereferences in regexp code + +https://bugzilla.gnome.org/show_bug.cgi?id=707749 + +Fix 3 cases where we might dereference NULL +--- + xmlregexp.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/xmlregexp.c b/xmlregexp.c +index 1f9911c..8e63d74 100644 +--- a/xmlregexp.c ++++ b/xmlregexp.c +@@ -3162,8 +3162,10 @@ xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) { + exec->status = -6; + return; + } +- memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, ++ if (exec->counts) { ++ memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, + exec->comp->nbCounters * sizeof(int)); ++ } + } + + #ifdef DEBUG_REGEXP_EXEC +@@ -4091,7 +4093,7 @@ rollback: + */ + exec->determinist = 0; + xmlFARegExecRollBack(exec); +- if (exec->status == 0) { ++ if ((exec->inputStack != NULL ) && (exec->status == 0)) { + value = exec->inputStack[exec->index].value; + data = exec->inputStack[exec->index].data; + #ifdef DEBUG_PUSH +@@ -4306,7 +4308,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, + (*nbval)++; + } + } else { +- if ((exec->comp->states[trans->to] != NULL) && ++ if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) && + (exec->comp->states[trans->to]->type != + XML_REGEXP_SINK_STATE)) { + if (atom->neg) diff --git a/debian/patches/0017-Fix-a-potential-NULL-dereference-in-tree-code.patch b/debian/patches/0017-Fix-a-potential-NULL-dereference-in-tree-code.patch new file mode 100644 index 0000000..2c55813 --- /dev/null +++ b/debian/patches/0017-Fix-a-potential-NULL-dereference-in-tree-code.patch @@ -0,0 +1,26 @@ +From: Daniel Veillard +Date: Wed, 11 Sep 2013 15:11:27 +0800 +Subject: Fix a potential NULL dereference in tree code + +https://bugzilla.gnome.org/show_bug.cgi?id=707750 + +Also reported by Gaurav, simple fix to check the pointer before +dereference +--- + tree.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tree.c b/tree.c +index 7e5af26..efc3ca2 100644 +--- a/tree.c ++++ b/tree.c +@@ -9780,7 +9780,8 @@ leave_node: + if (clone->parent != NULL) + clone->parent->last = clone; + clone = clone->parent; +- parentClone = clone->parent; ++ if (clone != NULL) ++ parentClone = clone->parent; + /* + * Process parent --> next; + */ diff --git a/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch b/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch deleted file mode 100644 index 3ae1c59..0000000 --- a/debian/patches/0017-Fix-pointer-dereferenced-before-null-check.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Gaurav -Date: Mon, 30 Sep 2013 10:43:47 +0800 -Subject: Fix pointer dereferenced before null check - -for https://bugzilla.gnome.org/show_bug.cgi?id=708364 - -xmlValidateElementContent is a private function but should still -check the ctxt argument before dereferencing ---- - valid.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/valid.c b/valid.c -index 6e53a76..e0832e7 100644 ---- a/valid.c -+++ b/valid.c -@@ -5236,7 +5236,7 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child, - xmlElementContentPtr cont; - const xmlChar *name; - -- if ((elemDecl == NULL) || (parent == NULL)) -+ if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL)) - return(-1); - cont = elemDecl->content; - name = elemDecl->name; diff --git a/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch b/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch deleted file mode 100644 index 48b4fa4..0000000 --- a/debian/patches/0018-Fix-a-bug-loading-some-compressed-files.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Mike Alexander -Date: Thu, 28 Nov 2013 23:21:23 +0800 -Subject: Fix a bug loading some compressed files - -For https://bugzilla.gnome.org/show_bug.cgi?id=712528 -Related to https://bugzilla.redhat.com/show_bug.cgi?id=877567 - -There is a bug in xzlib.c which causes certain compressed XML files to fail to -load correctly. The code in xz_decomp which attempts to verify the checksum -and length of the expanded data fails if the checksum or length at the end of -the file crosses a 1024 byte boundary. It calls gz_next4 to get those two -values. This function uses the stream state in state->zstrm, but calls -xz_avail which uses the state->strm stream info. This causes gz_next4 to -signal a premature EOF if the data it is fetching crosses a 1024 byte boundary. ---- - xzlib.c | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) - -diff --git a/xzlib.c b/xzlib.c -index 928bd17..cd045fa 100644 ---- a/xzlib.c -+++ b/xzlib.c -@@ -245,6 +245,20 @@ xz_avail(xz_statep state) - return 0; - } - -+#ifdef HAVE_ZLIB_H -+static int -+xz_avail_zstrm(xz_statep state) -+{ -+ int ret; -+ state->strm.avail_in = state->zstrm.avail_in; -+ state->strm.next_in = state->zstrm.next_in; -+ ret = xz_avail(state); -+ state->zstrm.avail_in = (uInt) state->strm.avail_in; -+ state->zstrm.next_in = (Bytef *) state->strm.next_in; -+ return ret; -+} -+#endif -+ - static int - is_format_xz(xz_statep state) - { -@@ -314,6 +328,10 @@ is_format_lzma(xz_statep state) - #define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \ - (strm->avail_in == 0 ? -1 : \ - (strm->avail_in--, *(strm->next_in)++))) -+/* Same thing, but from zstrm */ -+#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \ -+ (strm->avail_in == 0 ? -1 : \ -+ (strm->avail_in--, *(strm->next_in)++))) - - /* Get a four-byte little-endian integer and return 0 on success and the value - in *ret. Otherwise -1 is returned and *ret is not modified. */ -@@ -324,10 +342,10 @@ gz_next4(xz_statep state, unsigned long *ret) - unsigned long val; - z_streamp strm = &(state->zstrm); - -- val = NEXT(); -- val += (unsigned) NEXT() << 8; -- val += (unsigned long) NEXT() << 16; -- ch = NEXT(); -+ val = NEXTZ(); -+ val += (unsigned) NEXTZ() << 8; -+ val += (unsigned long) NEXTZ() << 16; -+ ch = NEXTZ(); - if (ch == -1) - return -1; - val += (unsigned long) ch << 24; diff --git a/debian/patches/0018-Fix-pointer-dereferenced-before-null-check.patch b/debian/patches/0018-Fix-pointer-dereferenced-before-null-check.patch new file mode 100644 index 0000000..3ae1c59 --- /dev/null +++ b/debian/patches/0018-Fix-pointer-dereferenced-before-null-check.patch @@ -0,0 +1,25 @@ +From: Gaurav +Date: Mon, 30 Sep 2013 10:43:47 +0800 +Subject: Fix pointer dereferenced before null check + +for https://bugzilla.gnome.org/show_bug.cgi?id=708364 + +xmlValidateElementContent is a private function but should still +check the ctxt argument before dereferencing +--- + valid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/valid.c b/valid.c +index 6e53a76..e0832e7 100644 +--- a/valid.c ++++ b/valid.c +@@ -5236,7 +5236,7 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child, + xmlElementContentPtr cont; + const xmlChar *name; + +- if ((elemDecl == NULL) || (parent == NULL)) ++ if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL)) + return(-1); + cont = elemDecl->content; + name = elemDecl->name; diff --git a/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch b/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch deleted file mode 100644 index ab0bde8..0000000 --- a/debian/patches/0019-Avoid-a-possibility-of-dangling-encoding-handler.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Gaurav -Date: Fri, 29 Nov 2013 23:10:50 +0800 -Subject: Avoid a possibility of dangling encoding handler - -For https://bugzilla.gnome.org/show_bug.cgi?id=711149 - -In Function: -int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) - -If the freed handler is any one of handlers[i] list, then it will make that -hanldlers[i] as dangling. This may lead to crash issues at places where -handlers is read. ---- - encoding.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/encoding.c b/encoding.c -index 7330e90..d4fc45f 100644 ---- a/encoding.c -+++ b/encoding.c -@@ -2851,14 +2851,25 @@ int - xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { - int ret = 0; - int tofree = 0; -+ int i, handler_in_list = 0; -+ - if (handler == NULL) return(-1); - if (handler->name == NULL) return(-1); -+ if (handlers != NULL) { -+ for (i = 0;i < nbCharEncodingHandler; i++) { -+ if (handler == handlers[i]) { -+ handler_in_list = 1; -+ break; -+ } -+ } -+ } - #ifdef LIBXML_ICONV_ENABLED - /* - * Iconv handlers can be used only once, free the whole block. - * and the associated icon resources. - */ -- if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { -+ if ((handler_in_list == 0) && -+ ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) { - tofree = 1; - if (handler->iconv_out != NULL) { - if (iconv_close(handler->iconv_out)) -@@ -2873,7 +2884,8 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { - } - #endif /* LIBXML_ICONV_ENABLED */ - #ifdef LIBXML_ICU_ENABLED -- if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { -+ if ((handler_in_list == 0) && -+ ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) { - tofree = 1; - if (handler->uconv_out != NULL) { - closeIcuConverter(handler->uconv_out); diff --git a/debian/patches/0019-Fix-a-bug-loading-some-compressed-files.patch b/debian/patches/0019-Fix-a-bug-loading-some-compressed-files.patch new file mode 100644 index 0000000..48b4fa4 --- /dev/null +++ b/debian/patches/0019-Fix-a-bug-loading-some-compressed-files.patch @@ -0,0 +1,69 @@ +From: Mike Alexander +Date: Thu, 28 Nov 2013 23:21:23 +0800 +Subject: Fix a bug loading some compressed files + +For https://bugzilla.gnome.org/show_bug.cgi?id=712528 +Related to https://bugzilla.redhat.com/show_bug.cgi?id=877567 + +There is a bug in xzlib.c which causes certain compressed XML files to fail to +load correctly. The code in xz_decomp which attempts to verify the checksum +and length of the expanded data fails if the checksum or length at the end of +the file crosses a 1024 byte boundary. It calls gz_next4 to get those two +values. This function uses the stream state in state->zstrm, but calls +xz_avail which uses the state->strm stream info. This causes gz_next4 to +signal a premature EOF if the data it is fetching crosses a 1024 byte boundary. +--- + xzlib.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/xzlib.c b/xzlib.c +index 928bd17..cd045fa 100644 +--- a/xzlib.c ++++ b/xzlib.c +@@ -245,6 +245,20 @@ xz_avail(xz_statep state) + return 0; + } + ++#ifdef HAVE_ZLIB_H ++static int ++xz_avail_zstrm(xz_statep state) ++{ ++ int ret; ++ state->strm.avail_in = state->zstrm.avail_in; ++ state->strm.next_in = state->zstrm.next_in; ++ ret = xz_avail(state); ++ state->zstrm.avail_in = (uInt) state->strm.avail_in; ++ state->zstrm.next_in = (Bytef *) state->strm.next_in; ++ return ret; ++} ++#endif ++ + static int + is_format_xz(xz_statep state) + { +@@ -314,6 +328,10 @@ is_format_lzma(xz_statep state) + #define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \ + (strm->avail_in == 0 ? -1 : \ + (strm->avail_in--, *(strm->next_in)++))) ++/* Same thing, but from zstrm */ ++#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \ ++ (strm->avail_in == 0 ? -1 : \ ++ (strm->avail_in--, *(strm->next_in)++))) + + /* Get a four-byte little-endian integer and return 0 on success and the value + in *ret. Otherwise -1 is returned and *ret is not modified. */ +@@ -324,10 +342,10 @@ gz_next4(xz_statep state, unsigned long *ret) + unsigned long val; + z_streamp strm = &(state->zstrm); + +- val = NEXT(); +- val += (unsigned) NEXT() << 8; +- val += (unsigned long) NEXT() << 16; +- ch = NEXT(); ++ val = NEXTZ(); ++ val += (unsigned) NEXTZ() << 8; ++ val += (unsigned long) NEXTZ() << 16; ++ ch = NEXTZ(); + if (ch == -1) + return -1; + val += (unsigned long) ch << 24; diff --git a/debian/patches/0020-Avoid-a-possibility-of-dangling-encoding-handler.patch b/debian/patches/0020-Avoid-a-possibility-of-dangling-encoding-handler.patch new file mode 100644 index 0000000..ab0bde8 --- /dev/null +++ b/debian/patches/0020-Avoid-a-possibility-of-dangling-encoding-handler.patch @@ -0,0 +1,57 @@ +From: Gaurav +Date: Fri, 29 Nov 2013 23:10:50 +0800 +Subject: Avoid a possibility of dangling encoding handler + +For https://bugzilla.gnome.org/show_bug.cgi?id=711149 + +In Function: +int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) + +If the freed handler is any one of handlers[i] list, then it will make that +hanldlers[i] as dangling. This may lead to crash issues at places where +handlers is read. +--- + encoding.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/encoding.c b/encoding.c +index 7330e90..d4fc45f 100644 +--- a/encoding.c ++++ b/encoding.c +@@ -2851,14 +2851,25 @@ int + xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { + int ret = 0; + int tofree = 0; ++ int i, handler_in_list = 0; ++ + if (handler == NULL) return(-1); + if (handler->name == NULL) return(-1); ++ if (handlers != NULL) { ++ for (i = 0;i < nbCharEncodingHandler; i++) { ++ if (handler == handlers[i]) { ++ handler_in_list = 1; ++ break; ++ } ++ } ++ } + #ifdef LIBXML_ICONV_ENABLED + /* + * Iconv handlers can be used only once, free the whole block. + * and the associated icon resources. + */ +- if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { ++ if ((handler_in_list == 0) && ++ ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) { + tofree = 1; + if (handler->iconv_out != NULL) { + if (iconv_close(handler->iconv_out)) +@@ -2873,7 +2884,8 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { + } + #endif /* LIBXML_ICONV_ENABLED */ + #ifdef LIBXML_ICU_ENABLED +- if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { ++ if ((handler_in_list == 0) && ++ ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) { + tofree = 1; + if (handler->uconv_out != NULL) { + closeIcuConverter(handler->uconv_out); diff --git a/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch b/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch deleted file mode 100644 index 6771dbb..0000000 --- a/debian/patches/0020-Fix-a-couple-of-missing-NULL-checks.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Gaurav -Date: Fri, 29 Nov 2013 23:28:21 +0800 -Subject: Fix a couple of missing NULL checks - -For https://bugzilla.gnome.org/show_bug.cgi?id=708681 ---- - tree.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/tree.c b/tree.c -index efc3ca2..43c3c57 100644 ---- a/tree.c -+++ b/tree.c -@@ -4294,6 +4294,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { - } - if (doc->intSubset == NULL) { - q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node ); -+ if (q == NULL) return(NULL); - q->doc = doc; - q->parent = parent; - doc->intSubset = (xmlDtdPtr) q; -@@ -4305,6 +4306,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { - } else - #endif /* LIBXML_TREE_ENABLED */ - q = xmlStaticCopyNode(node, doc, parent, 1); -+ if (q == NULL) return(NULL); - if (ret == NULL) { - q->prev = NULL; - ret = p = q; diff --git a/debian/patches/0021-Fix-a-couple-of-missing-NULL-checks.patch b/debian/patches/0021-Fix-a-couple-of-missing-NULL-checks.patch new file mode 100644 index 0000000..6771dbb --- /dev/null +++ b/debian/patches/0021-Fix-a-couple-of-missing-NULL-checks.patch @@ -0,0 +1,29 @@ +From: Gaurav +Date: Fri, 29 Nov 2013 23:28:21 +0800 +Subject: Fix a couple of missing NULL checks + +For https://bugzilla.gnome.org/show_bug.cgi?id=708681 +--- + tree.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tree.c b/tree.c +index efc3ca2..43c3c57 100644 +--- a/tree.c ++++ b/tree.c +@@ -4294,6 +4294,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { + } + if (doc->intSubset == NULL) { + q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node ); ++ if (q == NULL) return(NULL); + q->doc = doc; + q->parent = parent; + doc->intSubset = (xmlDtdPtr) q; +@@ -4305,6 +4306,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) { + } else + #endif /* LIBXML_TREE_ENABLED */ + q = xmlStaticCopyNode(node, doc, parent, 1); ++ if (q == NULL) return(NULL); + if (ret == NULL) { + q->prev = NULL; + ret = p = q; diff --git a/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch b/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch deleted file mode 100644 index 7820411..0000000 --- a/debian/patches/0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch +++ /dev/null @@ -1,148 +0,0 @@ -From: Daniel Veillard -Date: Mon, 9 Dec 2013 15:23:40 +0800 -Subject: adding init calls to xml and html Read parsing entry points - -As pointed out by "Tassyns, Bram " on the list -some call had it other didn't, clean it up and add to all missing -ones ---- - HTMLparser.c | 6 ++++++ - parser.c | 10 ++++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/HTMLparser.c b/HTMLparser.c -index dd0c1ea..44c1a3c 100644 ---- a/HTMLparser.c -+++ b/HTMLparser.c -@@ -6808,6 +6808,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) - - if (fd < 0) - return (NULL); -+ xmlInitParser(); - - xmlInitParser(); - input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); -@@ -6898,6 +6899,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - htmlCtxtReset(ctxt); - -@@ -6931,6 +6933,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - htmlCtxtReset(ctxt); - -@@ -6967,6 +6970,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, - return (NULL); - if (buffer == NULL) - return (NULL); -+ xmlInitParser(); - - htmlCtxtReset(ctxt); - -@@ -7009,6 +7013,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - htmlCtxtReset(ctxt); - -@@ -7053,6 +7058,7 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - htmlCtxtReset(ctxt); - -diff --git a/parser.c b/parser.c -index dd00399..ad400f4 100644 ---- a/parser.c -+++ b/parser.c -@@ -15217,6 +15217,7 @@ xmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int optio - - if (cur == NULL) - return (NULL); -+ xmlInitParser(); - - ctxt = xmlCreateDocParserCtxt(cur); - if (ctxt == NULL) -@@ -15239,6 +15240,7 @@ xmlReadFile(const char *filename, const char *encoding, int options) - { - xmlParserCtxtPtr ctxt; - -+ xmlInitParser(); - ctxt = xmlCreateURLParserCtxt(filename, options); - if (ctxt == NULL) - return (NULL); -@@ -15262,6 +15264,7 @@ xmlReadMemory(const char *buffer, int size, const char *URL, const char *encodin - { - xmlParserCtxtPtr ctxt; - -+ xmlInitParser(); - ctxt = xmlCreateMemoryParserCtxt(buffer, size); - if (ctxt == NULL) - return (NULL); -@@ -15290,6 +15293,7 @@ xmlReadFd(int fd, const char *URL, const char *encoding, int options) - - if (fd < 0) - return (NULL); -+ xmlInitParser(); - - input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); - if (input == NULL) -@@ -15333,6 +15337,7 @@ xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, - - if (ioread == NULL) - return (NULL); -+ xmlInitParser(); - - input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, - XML_CHAR_ENCODING_NONE); -@@ -15379,6 +15384,7 @@ xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - xmlCtxtReset(ctxt); - -@@ -15412,6 +15418,7 @@ xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - xmlCtxtReset(ctxt); - -@@ -15448,6 +15455,7 @@ xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, - return (NULL); - if (buffer == NULL) - return (NULL); -+ xmlInitParser(); - - xmlCtxtReset(ctxt); - -@@ -15492,6 +15500,7 @@ xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - xmlCtxtReset(ctxt); - -@@ -15537,6 +15546,7 @@ xmlCtxtReadIO(xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, - return (NULL); - if (ctxt == NULL) - return (NULL); -+ xmlInitParser(); - - xmlCtxtReset(ctxt); - diff --git a/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch b/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch deleted file mode 100644 index cc18db7..0000000 --- a/debian/patches/0022-Handling-of-XPath-function-arguments-in-error-case.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Nick Wellnhofer -Date: Fri, 20 Dec 2013 00:01:53 +0100 -Subject: Handling of XPath function arguments in error case - -The XPath engine tries to guarantee that every XPath function can pop -'nargs' non-NULL values off the stack. libxslt, for example, relies on -this assumption. But the check isn't thorough enough if there are errors -during the evaluation of arguments. This can lead to segfaults: - -https://mail.gnome.org/archives/xslt/2013-December/msg00005.html - -This commit makes the handling of function arguments more robust. - -* Bail out early when evaluation of XPath function arguments fails. -* Make sure that there are 'nargs' arguments in the current call frame. ---- - xpath.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/xpath.c b/xpath.c -index a676989..a75df9b 100644 ---- a/xpath.c -+++ b/xpath.c -@@ -13512,10 +13512,15 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) - int frame; - - frame = xmlXPathSetFrame(ctxt); -- if (op->ch1 != -1) -+ if (op->ch1 != -1) { - total += - xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); -- if (ctxt->valueNr < op->value) { -+ if (ctxt->error != XPATH_EXPRESSION_OK) { -+ xmlXPathPopFrame(ctxt, frame); -+ return (total); -+ } -+ } -+ if (ctxt->valueNr < ctxt->valueFrame + op->value) { - xmlGenericError(xmlGenericErrorContext, - "xmlXPathCompOpEval: parameter error\n"); - ctxt->error = XPATH_INVALID_OPERAND; diff --git a/debian/patches/0022-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch b/debian/patches/0022-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch new file mode 100644 index 0000000..7820411 --- /dev/null +++ b/debian/patches/0022-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch @@ -0,0 +1,148 @@ +From: Daniel Veillard +Date: Mon, 9 Dec 2013 15:23:40 +0800 +Subject: adding init calls to xml and html Read parsing entry points + +As pointed out by "Tassyns, Bram " on the list +some call had it other didn't, clean it up and add to all missing +ones +--- + HTMLparser.c | 6 ++++++ + parser.c | 10 ++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/HTMLparser.c b/HTMLparser.c +index dd0c1ea..44c1a3c 100644 +--- a/HTMLparser.c ++++ b/HTMLparser.c +@@ -6808,6 +6808,7 @@ htmlReadFd(int fd, const char *URL, const char *encoding, int options) + + if (fd < 0) + return (NULL); ++ xmlInitParser(); + + xmlInitParser(); + input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); +@@ -6898,6 +6899,7 @@ htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -6931,6 +6933,7 @@ htmlCtxtReadFile(htmlParserCtxtPtr ctxt, const char *filename, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -6967,6 +6970,7 @@ htmlCtxtReadMemory(htmlParserCtxtPtr ctxt, const char *buffer, int size, + return (NULL); + if (buffer == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -7009,6 +7013,7 @@ htmlCtxtReadFd(htmlParserCtxtPtr ctxt, int fd, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +@@ -7053,6 +7058,7 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + htmlCtxtReset(ctxt); + +diff --git a/parser.c b/parser.c +index dd00399..ad400f4 100644 +--- a/parser.c ++++ b/parser.c +@@ -15217,6 +15217,7 @@ xmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int optio + + if (cur == NULL) + return (NULL); ++ xmlInitParser(); + + ctxt = xmlCreateDocParserCtxt(cur); + if (ctxt == NULL) +@@ -15239,6 +15240,7 @@ xmlReadFile(const char *filename, const char *encoding, int options) + { + xmlParserCtxtPtr ctxt; + ++ xmlInitParser(); + ctxt = xmlCreateURLParserCtxt(filename, options); + if (ctxt == NULL) + return (NULL); +@@ -15262,6 +15264,7 @@ xmlReadMemory(const char *buffer, int size, const char *URL, const char *encodin + { + xmlParserCtxtPtr ctxt; + ++ xmlInitParser(); + ctxt = xmlCreateMemoryParserCtxt(buffer, size); + if (ctxt == NULL) + return (NULL); +@@ -15290,6 +15293,7 @@ xmlReadFd(int fd, const char *URL, const char *encoding, int options) + + if (fd < 0) + return (NULL); ++ xmlInitParser(); + + input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); + if (input == NULL) +@@ -15333,6 +15337,7 @@ xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, + + if (ioread == NULL) + return (NULL); ++ xmlInitParser(); + + input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx, + XML_CHAR_ENCODING_NONE); +@@ -15379,6 +15384,7 @@ xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15412,6 +15418,7 @@ xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15448,6 +15455,7 @@ xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size, + return (NULL); + if (buffer == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15492,6 +15500,7 @@ xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + +@@ -15537,6 +15546,7 @@ xmlCtxtReadIO(xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, + return (NULL); + if (ctxt == NULL) + return (NULL); ++ xmlInitParser(); + + xmlCtxtReset(ctxt); + diff --git a/debian/patches/0023-Handling-of-XPath-function-arguments-in-error-case.patch b/debian/patches/0023-Handling-of-XPath-function-arguments-in-error-case.patch new file mode 100644 index 0000000..cc18db7 --- /dev/null +++ b/debian/patches/0023-Handling-of-XPath-function-arguments-in-error-case.patch @@ -0,0 +1,41 @@ +From: Nick Wellnhofer +Date: Fri, 20 Dec 2013 00:01:53 +0100 +Subject: Handling of XPath function arguments in error case + +The XPath engine tries to guarantee that every XPath function can pop +'nargs' non-NULL values off the stack. libxslt, for example, relies on +this assumption. But the check isn't thorough enough if there are errors +during the evaluation of arguments. This can lead to segfaults: + +https://mail.gnome.org/archives/xslt/2013-December/msg00005.html + +This commit makes the handling of function arguments more robust. + +* Bail out early when evaluation of XPath function arguments fails. +* Make sure that there are 'nargs' arguments in the current call frame. +--- + xpath.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/xpath.c b/xpath.c +index a676989..a75df9b 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -13512,10 +13512,15 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + int frame; + + frame = xmlXPathSetFrame(ctxt); +- if (op->ch1 != -1) ++ if (op->ch1 != -1) { + total += + xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); +- if (ctxt->valueNr < op->value) { ++ if (ctxt->error != XPATH_EXPRESSION_OK) { ++ xmlXPathPopFrame(ctxt, frame); ++ return (total); ++ } ++ } ++ if (ctxt->valueNr < ctxt->valueFrame + op->value) { + xmlGenericError(xmlGenericErrorContext, + "xmlXPathCompOpEval: parameter error\n"); + ctxt->error = XPATH_INVALID_OPERAND; diff --git a/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch b/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch deleted file mode 100644 index c5a5d16..0000000 --- a/debian/patches/0023-Missing-initialization-for-the-catalog-module.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Daniel Veillard -Date: Sun, 26 Jan 2014 15:02:25 +0100 -Subject: Missing initialization for the catalog module - ---- - parser.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/parser.c b/parser.c -index ad400f4..7381a78 100644 ---- a/parser.c -+++ b/parser.c -@@ -14720,6 +14720,9 @@ xmlInitParser(void) { - #ifdef LIBXML_XPATH_ENABLED - xmlXPathInit(); - #endif -+#ifdef LIBXML_CATALOG_ENABLED -+ xmlInitializeCatalog(); -+#endif - xmlParserInitialized = 1; - #ifdef LIBXML_THREAD_ENABLED - } diff --git a/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch b/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch deleted file mode 100644 index edf1752..0000000 --- a/debian/patches/0024-Fix-an-fd-leak-in-an-error-case.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Daniel Veillard -Date: Thu, 6 Feb 2014 10:38:00 +0100 -Subject: Fix an fd leak in an error case - ---- - catalog.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/catalog.c b/catalog.c -index 8e34cd2..56991da 100644 ---- a/catalog.c -+++ b/catalog.c -@@ -994,6 +994,11 @@ xmlLoadFileContent(const char *filename) - content = (xmlChar*)xmlMallocAtomic(size + 10); - if (content == NULL) { - xmlCatalogErrMemory("allocating catalog data"); -+#ifdef HAVE_STAT -+ close(fd); -+#else -+ fclose(fd); -+#endif - return (NULL); - } - #ifdef HAVE_STAT diff --git a/debian/patches/0024-Missing-initialization-for-the-catalog-module.patch b/debian/patches/0024-Missing-initialization-for-the-catalog-module.patch new file mode 100644 index 0000000..c5a5d16 --- /dev/null +++ b/debian/patches/0024-Missing-initialization-for-the-catalog-module.patch @@ -0,0 +1,22 @@ +From: Daniel Veillard +Date: Sun, 26 Jan 2014 15:02:25 +0100 +Subject: Missing initialization for the catalog module + +--- + parser.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/parser.c b/parser.c +index ad400f4..7381a78 100644 +--- a/parser.c ++++ b/parser.c +@@ -14720,6 +14720,9 @@ xmlInitParser(void) { + #ifdef LIBXML_XPATH_ENABLED + xmlXPathInit(); + #endif ++#ifdef LIBXML_CATALOG_ENABLED ++ xmlInitializeCatalog(); ++#endif + xmlParserInitialized = 1; + #ifdef LIBXML_THREAD_ENABLED + } diff --git a/debian/patches/0025-Fix-an-fd-leak-in-an-error-case.patch b/debian/patches/0025-Fix-an-fd-leak-in-an-error-case.patch new file mode 100644 index 0000000..edf1752 --- /dev/null +++ b/debian/patches/0025-Fix-an-fd-leak-in-an-error-case.patch @@ -0,0 +1,24 @@ +From: Daniel Veillard +Date: Thu, 6 Feb 2014 10:38:00 +0100 +Subject: Fix an fd leak in an error case + +--- + catalog.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/catalog.c b/catalog.c +index 8e34cd2..56991da 100644 +--- a/catalog.c ++++ b/catalog.c +@@ -994,6 +994,11 @@ xmlLoadFileContent(const char *filename) + content = (xmlChar*)xmlMallocAtomic(size + 10); + if (content == NULL) { + xmlCatalogErrMemory("allocating catalog data"); ++#ifdef HAVE_STAT ++ close(fd); ++#else ++ fclose(fd); ++#endif + return (NULL); + } + #ifdef HAVE_STAT diff --git a/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch b/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch deleted file mode 100644 index 65eae92..0000000 --- a/debian/patches/0025-fixing-a-ptotential-uninitialized-access.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Daniel Veillard -Date: Thu, 6 Feb 2014 10:47:20 +0100 -Subject: fixing a ptotential uninitialized access - ---- - valid.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/valid.c b/valid.c -index e0832e7..114bb72 100644 ---- a/valid.c -+++ b/valid.c -@@ -6948,7 +6948,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, - int max) { - xmlValidCtxt vctxt; - int nb_valid_elements = 0; -- const xmlChar *elements[256]; -+ const xmlChar *elements[256]={0}; - int nb_elements = 0, i; - const xmlChar *name; - diff --git a/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch b/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch deleted file mode 100644 index 22d206a..0000000 --- a/debian/patches/0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Daniel Veillard -Date: Sat, 8 Feb 2014 02:22:35 +0800 -Subject: Fix xmlTextWriterWriteElement when a null content is given - ---- - xmlwriter.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/xmlwriter.c b/xmlwriter.c -index d3f29f8..27209b9 100644 ---- a/xmlwriter.c -+++ b/xmlwriter.c -@@ -2238,10 +2238,12 @@ xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name, - if (count == -1) - return -1; - sum += count; -- count = xmlTextWriterWriteString(writer, content); -- if (count == -1) -- return -1; -- sum += count; -+ if (content != NULL) { -+ count = xmlTextWriterWriteString(writer, content); -+ if (count == -1) -+ return -1; -+ sum += count; -+ } - count = xmlTextWriterEndElement(writer); - if (count == -1) - return -1; diff --git a/debian/patches/0026-fixing-a-ptotential-uninitialized-access.patch b/debian/patches/0026-fixing-a-ptotential-uninitialized-access.patch new file mode 100644 index 0000000..65eae92 --- /dev/null +++ b/debian/patches/0026-fixing-a-ptotential-uninitialized-access.patch @@ -0,0 +1,21 @@ +From: Daniel Veillard +Date: Thu, 6 Feb 2014 10:47:20 +0100 +Subject: fixing a ptotential uninitialized access + +--- + valid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/valid.c b/valid.c +index e0832e7..114bb72 100644 +--- a/valid.c ++++ b/valid.c +@@ -6948,7 +6948,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names, + int max) { + xmlValidCtxt vctxt; + int nb_valid_elements = 0; +- const xmlChar *elements[256]; ++ const xmlChar *elements[256]={0}; + int nb_elements = 0, i; + const xmlChar *name; + diff --git a/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch b/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch deleted file mode 100644 index 219d13a..0000000 --- a/debian/patches/0027-Avoid-a-possible-NULL-pointer-dereference.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Gaurav -Date: Tue, 18 Feb 2014 11:47:43 +0800 -Subject: Avoid a possible NULL pointer dereference - -For https://bugzilla.gnome.org/show_bug.cgi?id=708355 ---- - xmlmodule.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xmlmodule.c b/xmlmodule.c -index 7fe5bc2..50ed666 100644 ---- a/xmlmodule.c -+++ b/xmlmodule.c -@@ -115,7 +115,7 @@ xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol) - { - int rc = -1; - -- if ((NULL == module) || (symbol == NULL)) { -+ if ((NULL == module) || (symbol == NULL) || (name == NULL)) { - __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, - XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, - NULL, NULL, 0, 0, "null parameter\n"); diff --git a/debian/patches/0027-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch b/debian/patches/0027-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch new file mode 100644 index 0000000..22d206a --- /dev/null +++ b/debian/patches/0027-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch @@ -0,0 +1,29 @@ +From: Daniel Veillard +Date: Sat, 8 Feb 2014 02:22:35 +0800 +Subject: Fix xmlTextWriterWriteElement when a null content is given + +--- + xmlwriter.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/xmlwriter.c b/xmlwriter.c +index d3f29f8..27209b9 100644 +--- a/xmlwriter.c ++++ b/xmlwriter.c +@@ -2238,10 +2238,12 @@ xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name, + if (count == -1) + return -1; + sum += count; +- count = xmlTextWriterWriteString(writer, content); +- if (count == -1) +- return -1; +- sum += count; ++ if (content != NULL) { ++ count = xmlTextWriterWriteString(writer, content); ++ if (count == -1) ++ return -1; ++ sum += count; ++ } + count = xmlTextWriterEndElement(writer); + if (count == -1) + return -1; diff --git a/debian/patches/0028-Avoid-a-possible-NULL-pointer-dereference.patch b/debian/patches/0028-Avoid-a-possible-NULL-pointer-dereference.patch new file mode 100644 index 0000000..219d13a --- /dev/null +++ b/debian/patches/0028-Avoid-a-possible-NULL-pointer-dereference.patch @@ -0,0 +1,22 @@ +From: Gaurav +Date: Tue, 18 Feb 2014 11:47:43 +0800 +Subject: Avoid a possible NULL pointer dereference + +For https://bugzilla.gnome.org/show_bug.cgi?id=708355 +--- + xmlmodule.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xmlmodule.c b/xmlmodule.c +index 7fe5bc2..50ed666 100644 +--- a/xmlmodule.c ++++ b/xmlmodule.c +@@ -115,7 +115,7 @@ xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol) + { + int rc = -1; + +- if ((NULL == module) || (symbol == NULL)) { ++ if ((NULL == module) || (symbol == NULL) || (name == NULL)) { + __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE, + XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0, + NULL, NULL, 0, 0, "null parameter\n"); diff --git a/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch b/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch deleted file mode 100644 index 06ec27c..0000000 --- a/debian/patches/0028-Do-not-fetch-external-parameter-entities.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Daniel Veillard -Date: Tue, 22 Apr 2014 15:30:56 +0800 -Subject: Do not fetch external parameter entities - -Unless explicitely asked for when validating or replacing entities -with their value. Problem pointed out by Daniel Berrange ---- - parser.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/parser.c b/parser.c -index 7381a78..8aad7b4 100644 ---- a/parser.c -+++ b/parser.c -@@ -2595,6 +2595,20 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { - xmlCharEncoding enc; - - /* -+ * Note: external parsed entities will not be loaded, it is -+ * not required for a non-validating parser, unless the -+ * option of validating, or substituting entities were -+ * given. Doing so is far more secure as the parser will -+ * only process data coming from the document entity by -+ * default. -+ */ -+ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && -+ ((ctxt->options & XML_PARSE_NOENT) == 0) && -+ ((ctxt->options & XML_PARSE_DTDVALID) == 0) && -+ (ctxt->validate == 0)) -+ return; -+ -+ /* - * handle the extra spaces added before and after - * c.f. http://www.w3.org/TR/REC-xml#as-PE - * this is done independently. diff --git a/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch b/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch deleted file mode 100644 index 8a84731..0000000 --- a/debian/patches/0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Gaurav -Date: Fri, 9 May 2014 17:00:08 +0800 -Subject: Avoid Possible null pointer dereference in memory debug mode - -Fix a use before check on pointer -For https://bugzilla.gnome.org/show_bug.cgi?id=729849 ---- - xmlmemory.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/xmlmemory.c b/xmlmemory.c -index 25d9318..37dcf3b 100644 ---- a/xmlmemory.c -+++ b/xmlmemory.c -@@ -583,13 +583,15 @@ xmlMemBlocks(void) { - static void - xmlMemContentShow(FILE *fp, MEMHDR *p) - { -- int i,j,k,len = p->mh_size; -- const char *buf = (const char *) HDR_2_CLIENT(p); -+ int i,j,k,len; -+ const char *buf; - - if (p == NULL) { - fprintf(fp, " NULL"); - return; - } -+ len = p->mh_size; -+ buf = (const char *) HDR_2_CLIENT(p); - - for (i = 0;i < len;i++) { - if (buf[i] == 0) break; diff --git a/debian/patches/0029-Do-not-fetch-external-parameter-entities.patch b/debian/patches/0029-Do-not-fetch-external-parameter-entities.patch new file mode 100644 index 0000000..06ec27c --- /dev/null +++ b/debian/patches/0029-Do-not-fetch-external-parameter-entities.patch @@ -0,0 +1,35 @@ +From: Daniel Veillard +Date: Tue, 22 Apr 2014 15:30:56 +0800 +Subject: Do not fetch external parameter entities + +Unless explicitely asked for when validating or replacing entities +with their value. Problem pointed out by Daniel Berrange +--- + parser.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/parser.c b/parser.c +index 7381a78..8aad7b4 100644 +--- a/parser.c ++++ b/parser.c +@@ -2595,6 +2595,20 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + xmlCharEncoding enc; + + /* ++ * Note: external parsed entities will not be loaded, it is ++ * not required for a non-validating parser, unless the ++ * option of validating, or substituting entities were ++ * given. Doing so is far more secure as the parser will ++ * only process data coming from the document entity by ++ * default. ++ */ ++ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && ++ ((ctxt->options & XML_PARSE_NOENT) == 0) && ++ ((ctxt->options & XML_PARSE_DTDVALID) == 0) && ++ (ctxt->validate == 0)) ++ return; ++ ++ /* + * handle the extra spaces added before and after + * c.f. http://www.w3.org/TR/REC-xml#as-PE + * this is done independently. diff --git a/debian/patches/0030-Avoid-Possible-null-pointer-dereference-in-memory-de.patch b/debian/patches/0030-Avoid-Possible-null-pointer-dereference-in-memory-de.patch new file mode 100644 index 0000000..8a84731 --- /dev/null +++ b/debian/patches/0030-Avoid-Possible-null-pointer-dereference-in-memory-de.patch @@ -0,0 +1,32 @@ +From: Gaurav +Date: Fri, 9 May 2014 17:00:08 +0800 +Subject: Avoid Possible null pointer dereference in memory debug mode + +Fix a use before check on pointer +For https://bugzilla.gnome.org/show_bug.cgi?id=729849 +--- + xmlmemory.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xmlmemory.c b/xmlmemory.c +index 25d9318..37dcf3b 100644 +--- a/xmlmemory.c ++++ b/xmlmemory.c +@@ -583,13 +583,15 @@ xmlMemBlocks(void) { + static void + xmlMemContentShow(FILE *fp, MEMHDR *p) + { +- int i,j,k,len = p->mh_size; +- const char *buf = (const char *) HDR_2_CLIENT(p); ++ int i,j,k,len; ++ const char *buf; + + if (p == NULL) { + fprintf(fp, " NULL"); + return; + } ++ len = p->mh_size; ++ buf = (const char *) HDR_2_CLIENT(p); + + for (i = 0;i < len;i++) { + if (buf[i] == 0) break; diff --git a/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch b/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch deleted file mode 100644 index 7b24f6b..0000000 --- a/debian/patches/0030-xmllint-was-not-parsing-the-c14n11-flag.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: =?UTF-8?q?S=C3=A9rgio=20Batista?= -Date: Mon, 9 Jun 2014 22:10:15 +0800 -Subject: xmllint was not parsing the --c14n11 flag - -Cut and paste error, using the wrong variable ---- - xmllint.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xmllint.c b/xmllint.c -index d69722c..4a5d043 100644 ---- a/xmllint.c -+++ b/xmllint.c -@@ -2573,7 +2573,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { - fprintf(stderr, "Failed to canonicalize\n"); - progresult = XMLLINT_ERR_OUT; - } -- } else if (canonical) { -+ } else if (canonical_11) { - xmlChar *result = NULL; - int size; - diff --git a/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch b/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch deleted file mode 100644 index d9fc108..0000000 --- a/debian/patches/0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Daniel Veillard -Date: Wed, 11 Jun 2014 16:54:32 +0800 -Subject: Fix regressions introduced by CVE-2014-0191 patch - -A number of issues have been raised after the fix, and this patch -tries to correct all of them, though most were related to -postvalidation. -https://bugzilla.gnome.org/show_bug.cgi?id=730290 -and other reports on list, off-list and on Red Hat bugzilla ---- - parser.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/parser.c b/parser.c -index 8aad7b4..ea0ea65 100644 ---- a/parser.c -+++ b/parser.c -@@ -2595,8 +2595,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { - xmlCharEncoding enc; - - /* -- * Note: external parsed entities will not be loaded, it is -- * not required for a non-validating parser, unless the -+ * Note: external parameter entities will not be loaded, it -+ * is not required for a non-validating parser, unless the - * option of validating, or substituting entities were - * given. Doing so is far more secure as the parser will - * only process data coming from the document entity by -@@ -2605,6 +2605,9 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { - if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && - ((ctxt->options & XML_PARSE_NOENT) == 0) && - ((ctxt->options & XML_PARSE_DTDVALID) == 0) && -+ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) && -+ ((ctxt->options & XML_PARSE_DTDATTR) == 0) && -+ (ctxt->replaceEntities == 0) && - (ctxt->validate == 0)) - return; - -@@ -12609,6 +12612,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, - return(NULL); - } - -+ /* We are loading a DTD */ -+ ctxt->options |= XML_PARSE_DTDLOAD; -+ - /* - * Set-up the SAX context - */ -@@ -12736,6 +12742,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, - return(NULL); - } - -+ /* We are loading a DTD */ -+ ctxt->options |= XML_PARSE_DTDLOAD; -+ - /* - * Set-up the SAX context - */ diff --git a/debian/patches/0031-xmllint-was-not-parsing-the-c14n11-flag.patch b/debian/patches/0031-xmllint-was-not-parsing-the-c14n11-flag.patch new file mode 100644 index 0000000..7b24f6b --- /dev/null +++ b/debian/patches/0031-xmllint-was-not-parsing-the-c14n11-flag.patch @@ -0,0 +1,22 @@ +From: =?UTF-8?q?S=C3=A9rgio=20Batista?= +Date: Mon, 9 Jun 2014 22:10:15 +0800 +Subject: xmllint was not parsing the --c14n11 flag + +Cut and paste error, using the wrong variable +--- + xmllint.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xmllint.c b/xmllint.c +index d69722c..4a5d043 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -2573,7 +2573,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { + fprintf(stderr, "Failed to canonicalize\n"); + progresult = XMLLINT_ERR_OUT; + } +- } else if (canonical) { ++ } else if (canonical_11) { + xmlChar *result = NULL; + int size; + diff --git a/debian/patches/0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch b/debian/patches/0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch new file mode 100644 index 0000000..d9fc108 --- /dev/null +++ b/debian/patches/0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch @@ -0,0 +1,58 @@ +From: Daniel Veillard +Date: Wed, 11 Jun 2014 16:54:32 +0800 +Subject: Fix regressions introduced by CVE-2014-0191 patch + +A number of issues have been raised after the fix, and this patch +tries to correct all of them, though most were related to +postvalidation. +https://bugzilla.gnome.org/show_bug.cgi?id=730290 +and other reports on list, off-list and on Red Hat bugzilla +--- + parser.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/parser.c b/parser.c +index 8aad7b4..ea0ea65 100644 +--- a/parser.c ++++ b/parser.c +@@ -2595,8 +2595,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + xmlCharEncoding enc; + + /* +- * Note: external parsed entities will not be loaded, it is +- * not required for a non-validating parser, unless the ++ * Note: external parameter entities will not be loaded, it ++ * is not required for a non-validating parser, unless the + * option of validating, or substituting entities were + * given. Doing so is far more secure as the parser will + * only process data coming from the document entity by +@@ -2605,6 +2605,9 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { + if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) && + ((ctxt->options & XML_PARSE_NOENT) == 0) && + ((ctxt->options & XML_PARSE_DTDVALID) == 0) && ++ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) && ++ ((ctxt->options & XML_PARSE_DTDATTR) == 0) && ++ (ctxt->replaceEntities == 0) && + (ctxt->validate == 0)) + return; + +@@ -12609,6 +12612,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, + return(NULL); + } + ++ /* We are loading a DTD */ ++ ctxt->options |= XML_PARSE_DTDLOAD; ++ + /* + * Set-up the SAX context + */ +@@ -12736,6 +12742,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID, + return(NULL); + } + ++ /* We are loading a DTD */ ++ ctxt->options |= XML_PARSE_DTDLOAD; ++ + /* + * Set-up the SAX context + */ diff --git a/debian/patches/series b/debian/patches/series index 4ea5bbe..ce6e665 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,31 +1,32 @@ 0001-modify-xml2-config-and-pkgconfig-behaviour.patch -0002-Fix-an-error-in-xmlCleanupParser.patch -0003-Fix-missing-break-on-last-function-for-attributes.patch -0004-xmllint-memory-should-fail-on-empty-files.patch -0005-properly-quote-the-namespace-uris-written-out-during.patch -0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch -0007-missing-else-in-xlink.c.patch -0008-Catch-malloc-error-and-exit-accordingly.patch -0009-Fix-handling-of-mmap-errors.patch -0010-Avoid-crash-if-allocation-fails.patch -0011-Fix-a-possible-NULL-dereference.patch -0012-Clear-up-a-potential-NULL-dereference.patch -0013-Fix-XPath-optimization-with-predicates.patch -0014-xmllint-pretty-crashed-without-following-numeric-arg.patch -0015-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch -0016-Fix-a-potential-NULL-dereference-in-tree-code.patch -0017-Fix-pointer-dereferenced-before-null-check.patch -0018-Fix-a-bug-loading-some-compressed-files.patch -0019-Avoid-a-possibility-of-dangling-encoding-handler.patch -0020-Fix-a-couple-of-missing-NULL-checks.patch -0021-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch -0022-Handling-of-XPath-function-arguments-in-error-case.patch -0023-Missing-initialization-for-the-catalog-module.patch -0024-Fix-an-fd-leak-in-an-error-case.patch -0025-fixing-a-ptotential-uninitialized-access.patch -0026-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch -0027-Avoid-a-possible-NULL-pointer-dereference.patch -0028-Do-not-fetch-external-parameter-entities.patch -0029-Avoid-Possible-null-pointer-dereference-in-memory-de.patch -0030-xmllint-was-not-parsing-the-c14n11-flag.patch -0031-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch +0002-fix-python-multiarch-includes.patch +0003-Fix-an-error-in-xmlCleanupParser.patch +0004-Fix-missing-break-on-last-function-for-attributes.patch +0005-xmllint-memory-should-fail-on-empty-files.patch +0006-properly-quote-the-namespace-uris-written-out-during.patch +0007-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch +0008-missing-else-in-xlink.c.patch +0009-Catch-malloc-error-and-exit-accordingly.patch +0010-Fix-handling-of-mmap-errors.patch +0011-Avoid-crash-if-allocation-fails.patch +0012-Fix-a-possible-NULL-dereference.patch +0013-Clear-up-a-potential-NULL-dereference.patch +0014-Fix-XPath-optimization-with-predicates.patch +0015-xmllint-pretty-crashed-without-following-numeric-arg.patch +0016-Fix-potential-NULL-pointer-dereferences-in-regexp-co.patch +0017-Fix-a-potential-NULL-dereference-in-tree-code.patch +0018-Fix-pointer-dereferenced-before-null-check.patch +0019-Fix-a-bug-loading-some-compressed-files.patch +0020-Avoid-a-possibility-of-dangling-encoding-handler.patch +0021-Fix-a-couple-of-missing-NULL-checks.patch +0022-adding-init-calls-to-xml-and-html-Read-parsing-entry.patch +0023-Handling-of-XPath-function-arguments-in-error-case.patch +0024-Missing-initialization-for-the-catalog-module.patch +0025-Fix-an-fd-leak-in-an-error-case.patch +0026-fixing-a-ptotential-uninitialized-access.patch +0027-Fix-xmlTextWriterWriteElement-when-a-null-content-is.patch +0028-Avoid-a-possible-NULL-pointer-dereference.patch +0029-Do-not-fetch-external-parameter-entities.patch +0030-Avoid-Possible-null-pointer-dereference-in-memory-de.patch +0031-xmllint-was-not-parsing-the-c14n11-flag.patch +0032-Fix-regressions-introduced-by-CVE-2014-0191-patch.patch -- cgit v1.2.3 From a0adc7100eb2948fb35fa69315f4d66ef077dfa8 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 9 Jul 2014 05:37:58 +0800 Subject: Set PYTHON_LIBS for cross builds --- debian/rules | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index dcd4905..55b006d 100755 --- a/debian/rules +++ b/debian/rules @@ -55,8 +55,11 @@ dobuild-%: doconfigure-% dh_auto_build --builddirectory=$(BUILD_DIR) -- $(BUILD_FLAGS) dobuild-python%: BUILD_DIR=builddir/main/$* -dobuild-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)' -dobuild-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \ +dobuild-python%: BUILD_FLAGS = libxml2mod_la_LIBADD='$$(mylibs)' \ + PYTHON_INCLUDES="$(shell $(DEB_HOST_GNU_TYPE)-python-config --includes)" \ + PYTHON_LIBS="$(shell $(DEB_HOST_GNU_TYPE)-python-config --ldflags)" +dobuild-python%-dbg: BUILD_FLAGS += PYTHON_INCLUDES="$(shell $(DEB_HOST_GNU_TYPE)-python-dbg-config --includes)" \ + PYTHON_LIBS="$(shell $(DEB_HOST_GNU_TYPE)-python-dbg-config --ldflags)" \ CFLAGS="$(CFLAGS) -Wall -g -O0" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) \ -L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)" build-arch: $(TARGETS:%=dobuild-%) -- cgit v1.2.3 From 1166c939ce1cb9106f8a51be3026f3ee0e1ccba9 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 05:44:56 +0800 Subject: Bump std-ver: 3.9.4 -> 3.9.5, no change. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/control b/debian/control index 6281e14..1220df1 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Priority: optional Section: libs Maintainer: Debian XML/SGML Group Uploaders: Aron Xu , YunQiang Su -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Build-Depends: debhelper (>= 9), dh-autoreconf, autotools-dev, libpython-all-dev, libpython-all-dbg, python-all-dev:any (>= 2.7.5-5~), python-all-dbg:any, -- cgit v1.2.3 From 3a8c2d58eab0410fe5e79a112614aa9be061dc46 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Wed, 9 Jul 2014 06:00:34 +0800 Subject: Add new changelog entry --- debian/changelog | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5433d31..a2f9950 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,33 @@ +libxml2 (2.9.1+dfsg1-4) unstable; urgency=low + + [ Christian Svensson ] + * Do not build-depend on readline (Closes: #742350) + + [ Daniel Schepler ] + * Patch to bootstrap without python (Closes: #738080) + + [ Helmut Grohne ] + * Drop unneeded B-D on perl and binutils (Closes: #753005) + + [ Adam Conrad ] + * Actually run dh_autoreconf, which the old/new mixed rules file misses. + + [ Matthias Klose ] + * Add patch to fix python multiarch issue + * Allow the package to cross-build by tweaking B-Ds on python + * Set PYTHON_LIBS for cross builds + + [ Aron Xu ] + * Use correct $CC + * Configure udeb without python + * New round of cherry-picking upstream fixes + - Includes fixes for CVE-2014-0191 (Closes: #747309). + * Call prename with -vf + * Require python-all-dev (>= 2.7.5-5~) + * Bump std-ver: 3.9.4 -> 3.9.5, no change + + -- Aron Xu Wed, 09 Jul 2014 05:40:15 +0800 + libxml2 (2.9.1+dfsg1-3) unstable; urgency=low * debian/patches/0007-Fix-XPath-optimization-with-predicates.patch: -- cgit v1.2.3