diff options
Diffstat (limited to 'meta/recipes-core/libxml/libxml2')
10 files changed, 272 insertions, 303 deletions
diff --git a/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch b/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch deleted file mode 100644 index 16c229574c..0000000000 --- a/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 28a9dc642ffd759df1e48be247a114f440a6c16e Mon Sep 17 00:00:00 2001 -From: Nick Wellnhofer <wellnhofer@aevum.de> -Date: Mon, 30 Jul 2018 13:14:11 +0200 -Subject: [PATCH] Fix infinite loop in LZMA decompression -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Check the liblzma error code more thoroughly to avoid infinite loops. - -Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13 -Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914 - -This is CVE-2018-9251 and CVE-2018-14567. - -Thanks to Dongliang Mu and Simon Wörner for the reports. - -CVE: CVE-2018-9251 -CVE: CVE-2018-14567 -Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/2240fbf5912054af025fb6e01e26375100275e74] -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - xzlib.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/xzlib.c b/xzlib.c -index a839169..0ba88cf 100644 ---- a/xzlib.c -+++ b/xzlib.c -@@ -562,6 +562,10 @@ xz_decomp(xz_statep state) - "internal error: inflate stream corrupt"); - return -1; - } -+ /* -+ * FIXME: Remapping a couple of error codes and falling through -+ * to the LZMA error handling looks fragile. -+ */ - if (ret == Z_MEM_ERROR) - ret = LZMA_MEM_ERROR; - if (ret == Z_DATA_ERROR) -@@ -587,6 +591,11 @@ xz_decomp(xz_statep state) - xz_error(state, LZMA_PROG_ERROR, "compression error"); - return -1; - } -+ if ((state->how != GZIP) && -+ (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) { -+ xz_error(state, ret, "lzma error"); -+ return -1; -+ } - } while (strm->avail_out && ret != LZMA_STREAM_END); - - /* update available output and crc check value */ --- -2.7.4 - diff --git a/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch b/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch index 2b92dbc8dc..6d9ede6194 100644 --- a/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch +++ b/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch @@ -1,4 +1,4 @@ -From 78dbd4c09d617a9cb730d796f94ee4d93840d3cc Mon Sep 17 00:00:00 2001 +From ea1993d1d9a18c5e61b9cb271892b0a48f508d32 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt <pkj@axis.com> Date: Fri, 9 Jun 2017 17:50:46 +0200 Subject: [PATCH] Make ptest run the python tests if python is enabled @@ -9,17 +9,16 @@ be due to the fact that the tests are forced to run with Python 3. Upstream-Status: Inappropriate [OE specific] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> --- - Makefile.am | 2 +- - python/Makefile.am | 9 +++++++++ - python/tests/Makefile.am | 12 ++++++++++-- - python/tests/tstLastError.py | 2 +- - 4 files changed, 21 insertions(+), 4 deletions(-) + Makefile.am | 2 +- + python/Makefile.am | 9 +++++++++ + python/tests/Makefile.am | 10 ++++++++++ + 3 files changed, 20 insertions(+), 1 deletion(-) -Index: libxml2-2.9.7/Makefile.am -=================================================================== ---- libxml2-2.9.7.orig/Makefile.am -+++ libxml2-2.9.7/Makefile.am -@@ -207,9 +207,9 @@ install-ptest: +diff --git a/Makefile.am b/Makefile.am +index b428452b..dc18d6dd 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -203,9 +203,9 @@ install-ptest: install $(check_PROGRAMS) $(DESTDIR)) cp -r $(srcdir)/test $(DESTDIR) cp -r $(srcdir)/result $(DESTDIR) @@ -30,11 +29,11 @@ Index: libxml2-2.9.7/Makefile.am runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) -Index: libxml2-2.9.7/python/Makefile.am -=================================================================== ---- libxml2-2.9.7.orig/python/Makefile.am -+++ libxml2-2.9.7/python/Makefile.am -@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class +diff --git a/python/Makefile.am b/python/Makefile.am +index 34aed96c..ba3ec6a4 100644 +--- a/python/Makefile.am ++++ b/python/Makefile.am +@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class.txt $(BUILT_SOURCES) $(GENERATED): $(srcdir)/generator.py $(API_DESC) $(PYTHON) $(srcdir)/generator.py $(srcdir) @@ -51,10 +50,10 @@ Index: libxml2-2.9.7/python/Makefile.am +.PHONY: tests test tests test: all cd tests && $(MAKE) tests -Index: libxml2-2.9.7/python/tests/Makefile.am -=================================================================== ---- libxml2-2.9.7.orig/python/tests/Makefile.am -+++ libxml2-2.9.7/python/tests/Makefile.am +diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am +index 227e24df..3568c2d2 100644 +--- a/python/tests/Makefile.am ++++ b/python/tests/Makefile.am @@ -59,6 +59,11 @@ XMLS= \ CLEANFILES = core tmp.xml *.pyc @@ -67,30 +66,21 @@ Index: libxml2-2.9.7/python/tests/Makefile.am tests: $(PYTESTS) @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done @echo "## running Python regression tests" -@@ -68,8 +73,11 @@ tests: $(PYTESTS) - export LD_LIBRARY_PATH; \ - for test in $(PYTESTS) ; \ - do log=`$(PYTHON) $(srcdir)/$$test` ; \ -- if [ "`echo $$log | grep OK`" = "" ] ; then \ -- echo "-- $$test" ; echo "$$log" ; fi ; done) -+ if [ "`echo $$log | grep OK`" ]; then \ -+ echo "PASS: $$test"; else \ -+ echo "$$log"; echo "FAIL: $$test"; fi; done) +@@ -70,9 +75,14 @@ tests: $(PYTESTS) + if [ "$$?" -ne 0 ] ; then \ + echo "-- $$test" ; \ + echo "$$log" ; \ ++ echo "FAIL: $$test"; \ + exit 1 ; \ ++ else \ ++ echo "PASS: $$test"; \ + fi ; \ + done) else +install-ptest: + tests: endif -Index: libxml2-2.9.7/python/tests/tstLastError.py -=================================================================== ---- libxml2-2.9.7.orig/python/tests/tstLastError.py -+++ libxml2-2.9.7/python/tests/tstLastError.py -@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase): - when the exception is raised, check the libxml2.lastError for - expected values.""" - # disable the default error handler -- libxml2.registerErrorHandler(None,None) -+ libxml2.registerErrorHandler(lambda ctx,str: None,None) - try: - f(*args) - except exc: +-- +2.25.1 + diff --git a/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch b/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch deleted file mode 100644 index b34479f318..0000000000 --- a/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b4bee17b158e289e5c4c9045e64e5374ccafe068 Mon Sep 17 00:00:00 2001 -From: Salvatore Bonaccorso <carnil@debian.org> -Date: Tue, 3 Jul 2018 15:54:03 +0800 -Subject: [PATCH] Out-of-bounds read in htmlParseTryOrFinish (CVE-2017-8872) - -https://bugzilla.gnome.org/show_bug.cgi?id=775200 -Fixes bug 775200. - -Signed-off-by: Salvatore Bonaccorso <carnil@debian.org> - -Upstream-Status: Submitted -https://bug775200.bugzilla-attachments.gnome.org/attachment.cgi?id=366193 -CVE: CVE-2017-8872 -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - parser.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/parser.c b/parser.c -index ca9fde2..fb4c889 100644 ---- a/parser.c -+++ b/parser.c -@@ -12464,7 +12464,11 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) { - } - ctxt->input->cur = BAD_CAST""; - ctxt->input->base = ctxt->input->cur; -- ctxt->input->end = ctxt->input->cur; -+ ctxt->input->end = ctxt->input->cur; -+ if (ctxt->input->buf) -+ xmlBufEmpty (ctxt->input->buf->buffer); -+ else -+ ctxt->input->length = 0; - } - } - --- -2.7.4 - diff --git a/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch b/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch deleted file mode 100644 index 21668e25ad..0000000000 --- a/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch +++ /dev/null @@ -1,45 +0,0 @@ -libxml2-2.9.8: Fix CVE-2018-14404 - -[No upstream tracking] -- https://gitlab.gnome.org/GNOME/libxml2/issues/5 - -- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817 - -- https://bugzilla.redhat.com/show_bug.cgi?id=1595985 - -xpath: Fix nullptr deref with XPath logic ops - -If the XPath stack is corrupted, for example by a misbehaving extension -function, the "and" and "or" XPath operators could dereference NULL -pointers. Check that the XPath stack isn't empty and optimize the -logic operators slightly. - -Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/a436374994c47b12d5de1b8b1d191a098fa23594] -CVE: CVE-2018-14404 -Signed-off-by: Andrej Valek <andrej.valek@siemens.com> - -diff --git a/xpath.c b/xpath.c -index f440696..75cac5c 100644 ---- a/xpath.c -+++ b/xpath.c -@@ -13297,9 +13297,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) - return(0); - } - xmlXPathBooleanFunction(ctxt, 1); -- arg1 = valuePop(ctxt); -- arg1->boolval &= arg2->boolval; -- valuePush(ctxt, arg1); -+ if (ctxt->value != NULL) -+ ctxt->value->boolval &= arg2->boolval; - xmlXPathReleaseObject(ctxt->context, arg2); - return (total); - case XPATH_OP_OR: -@@ -13323,9 +13322,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) - return(0); - } - xmlXPathBooleanFunction(ctxt, 1); -- arg1 = valuePop(ctxt); -- arg1->boolval |= arg2->boolval; -- valuePush(ctxt, arg1); -+ if (ctxt->value != NULL) -+ ctxt->value->boolval |= arg2->boolval; - xmlXPathReleaseObject(ctxt->context, arg2); - return (total); - case XPATH_OP_EQUAL: diff --git a/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch b/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch index 51a9e1935f..ad719d4f5f 100644 --- a/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch +++ b/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch @@ -1,14 +1,23 @@ -Make sure that Makefile doesn't try to compile these tests again -on the target where the source dependencies won't be available. +From 395c0f53ec226aaabedb166e6b3a7f8590b95a5f Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sat, 11 May 2019 20:39:15 +0800 +Subject: [PATCH] Make sure that Makefile doesn't try to compile these tests + again on the target where the source dependencies won't be available. Upstream-Status: Inappropriate [cross-compile specific] Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> -Index: libxml2-2.9.7/Makefile.am -=================================================================== ---- libxml2-2.9.7.orig/Makefile.am -+++ libxml2-2.9.7/Makefile.am +Rebase to 2.9.9 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + Makefile.am | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 8f4e43d..5edb930 100644 +--- a/Makefile.am ++++ b/Makefile.am @@ -211,8 +211,7 @@ install-ptest: sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile $(MAKE) -C python install-ptest @@ -19,3 +28,6 @@ Index: libxml2-2.9.7/Makefile.am [ -d test ] || $(LN_S) $(srcdir)/test . [ -d result ] || $(LN_S) $(srcdir)/result . $(CHECKER) ./runtest$(EXEEXT) && \ +-- +2.7.4 + diff --git a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch index 1147017b61..fd8e469dd3 100644 --- a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch +++ b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch @@ -1,14 +1,19 @@ -Upstream-Status: Backport [from debian: bugs.debian.org/439843] +From 056b14345b1abd76a761ab14538f1bc21302781a Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sat, 11 May 2019 20:26:51 +0800 +Subject: [PATCH] libxml 64bit +Upstream-Status: Backport [from debian: bugs.debian.org/439843] +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- - libxml.h | 3 +++ + libxml.h | 3 +++ 1 file changed, 3 insertions(+) ---- libxml2-2.6.29.orig/libxml.h -+++ libxml2-2.6.29/libxml.h -@@ -11,10 +11,13 @@ - - #ifndef NO_LARGEFILE_SOURCE +diff --git a/libxml.h b/libxml.h +index 64e30f7..4e80d90 100644 +--- a/libxml.h ++++ b/libxml.h +@@ -15,6 +15,9 @@ #ifndef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE #endif @@ -18,5 +23,6 @@ Upstream-Status: Backport [from debian: bugs.debian.org/439843] #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif - #endif - +-- +2.7.4 + diff --git a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch index d9ed1516fe..d211f65da3 100644 --- a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch +++ b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch @@ -1,15 +1,35 @@ -AM_PATH_XML2 uses xml-config which we disable through +From f57da62218cf72c1342da82abafdac6b0a2e4997 Mon Sep 17 00:00:00 2001 +From: Tony Tascioglu <tony.tascioglu@windriver.com> +Date: Fri, 14 May 2021 11:50:35 -0400 +Subject: [PATCH] AM_PATH_XML2 uses xml-config which we disable through + binconfig-disabled.bbclass, so port it to use pkg-config instead. -Upstream-Status: Pending +This cannot be upstreamed, as the original macro supports various +optional arguments which cannot be supported with a direct call +to pkg-config. + +Upstream-Status: Inappropriate [oe-core specific; see above] Signed-off-by: Ross Burton <ross.burton@intel.com> -diff --git a/libxml.m4 b/libxml.m4 -index 68cd824..5fa0a9b 100644 ---- a/libxml.m4 -+++ b/libxml.m4 -@@ -1,188 +1,12 @@ +Rebase to 2.9.9 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +Updated to apply cleanly to v2.9.12 + +Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> +--- + libxml.m4 | 190 ++---------------------------------------------------- + 1 file changed, 5 insertions(+), 185 deletions(-) + +Index: libxml2-2.9.13/libxml.m4 +=================================================================== +--- libxml2-2.9.13.orig/libxml.m4 ++++ libxml2-2.9.13/libxml.m4 +@@ -1,191 +1,12 @@ -# Configure paths for LIBXML2 +-# Simon Josefsson 2020-02-12 +-# Fix autoconf 2.70+ warnings -# Mike Hommey 2004-06-19 -# use CPPFLAGS instead of CFLAGS -# Toshio Kuratomi 2001-04-21 @@ -69,7 +89,8 @@ index 68cd824..5fa0a9b 100644 -dnl (Also sanity checks the results of xml2-config to some extent) -dnl - rm -f conf.xmltest -- AC_TRY_RUN([ +- AC_RUN_IFELSE( +- [AC_LANG_SOURCE([[ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> @@ -130,21 +151,20 @@ index 68cd824..5fa0a9b 100644 - { - printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", - xml_major_version, xml_minor_version, xml_micro_version); -- printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", +- printf("*** You need a version of libxml newer than %d.%d.%d.\n", - major, minor, micro); -- printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); - printf("*** correct copy of xml2-config. (In this case, you will have to\n"); -- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); +- printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - return 1; -} --],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) +-]])],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - fi @@ -169,10 +189,11 @@ index 68cd824..5fa0a9b 100644 - echo "*** Could not run libxml test program, checking why..." - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - LIBS="$LIBS $XML_LIBS" -- AC_TRY_LINK([ +- AC_LINK_IFELSE( +- [AC_LANG_PROGRAM([[ -#include <libxml/xmlversion.h> -#include <stdio.h> --], [ LIBXML_TEST_VERSION; return 0;], +-]], [[ LIBXML_TEST_VERSION; return 0;]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding LIBXML or finding the wrong" - echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" diff --git a/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch index e83c8325e5..956ff3f33e 100644 --- a/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch +++ b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch @@ -1,4 +1,7 @@ -Allow us to pass in PYTHON_SITE_PACKAGES +From b038c3452667ed17ddb0e791cd7bdc7f8774ac29 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Sat, 11 May 2019 20:35:20 +0800 +Subject: [PATCH] Allow us to pass in PYTHON_SITE_PACKAGES The python binary used when building for nativesdk doesn't give us the correct path here so we need to be able to specify it ourselves. @@ -6,16 +9,18 @@ correct path here so we need to be able to specify it ourselves. Upstream-Status: Inappropriate [config] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> -Rebase to 2.9.2 +Rebase to 2.9.9 + Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac +index ca911f3..3bbd654 100644 --- a/configure.ac +++ b/configure.ac -@@ -813,7 +813,8 @@ dnl +@@ -808,7 +808,8 @@ dnl PYTHON_VERSION= PYTHON_INCLUDES= @@ -26,5 +31,5 @@ diff --git a/configure.ac b/configure.ac pythondir= if test "$with_python" != "no" ; then -- -1.9.1 +2.7.4 diff --git a/meta/recipes-core/libxml/libxml2/remove-fuzz-from-ptests.patch b/meta/recipes-core/libxml/libxml2/remove-fuzz-from-ptests.patch new file mode 100644 index 0000000000..66694af388 --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/remove-fuzz-from-ptests.patch @@ -0,0 +1,44 @@ +From e49a0d4a8f3f725d6f683854e1cad36a3cd02962 Mon Sep 17 00:00:00 2001 +From: Tony Tascioglu <tony.tascioglu@windriver.com> +Date: Wed, 19 May 2021 19:43:56 -0400 +Subject: [PATCH] Remove fuzz testing from executing with ptests. + +Upstream version 2.9.12 introduced new fuzz-testing and a corresponding +folder fuzz. These tests are not required for ptests of this package. + +This patch removes the fuzz testing targets from the Makefile. +Otherwise, running the ptests will fail due to the invalid directory. + +Upstream-Status: Inappropriate [oe specific] +Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> +--- + Makefile.am | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index a9284b95..3d7b344d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,9 +2,9 @@ + + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR) ++SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) + +-DIST_SUBDIRS = include . doc example fuzz python xstc ++DIST_SUBDIRS = include . doc example python xstc + + AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include + +@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ + $(CHECKER) ./runxmlconf$(EXEEXT) + @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ + $(MAKE) tests ; fi) +- @cd fuzz; $(MAKE) tests + + check: all runtests + +-- +2.25.1 + diff --git a/meta/recipes-core/libxml/libxml2/runtest.patch b/meta/recipes-core/libxml/libxml2/runtest.patch index 544dc05834..a89dac8b75 100644 --- a/meta/recipes-core/libxml/libxml2/runtest.patch +++ b/meta/recipes-core/libxml/libxml2/runtest.patch @@ -1,14 +1,33 @@ -Add 'install-ptest' rule. +From 6172ccd1e74bc181f5298f19e240234e12876abe Mon Sep 17 00:00:00 2001 +From: Tony Tascioglu <tony.tascioglu@windriver.com> +Date: Tue, 11 May 2021 11:57:46 -0400 +Subject: [PATCH] Add 'install-ptest' rule. + Print a standard result line for each test. Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> Signed-off-by: Andrej Valek <andrej.valek@siemens.com> -Upstream-Status: Backport +Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/137] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> +--- + Makefile.am | 9 +++ + runsuite.c | 1 + + runtest.c | 2 + + runxmlconf.c | 1 + + testapi.c | 122 ++++++++++++++++++++++++++------------- + testchar.c | 156 +++++++++++++++++++++++++++++++++++--------------- + testdict.c | 1 + + testlimits.c | 1 + + testrecurse.c | 2 + + 9 files changed, 210 insertions(+), 85 deletions(-) -diff -uNr a/Makefile.am b/Makefile.am ---- a/Makefile.am 2017-12-02 09:58:10.000000000 +0100 -+++ b/Makefile.am 2018-03-20 08:27:34.360505864 +0100 -@@ -202,6 +202,15 @@ +diff --git a/Makefile.am b/Makefile.am +index 05d1671f..ae622745 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -198,6 +198,15 @@ runxmlconf_LDADD= $(LDADDS) #testOOM_DEPENDENCIES = $(DEPS) #testOOM_LDADD= $(LDADDS) @@ -24,10 +43,11 @@ diff -uNr a/Makefile.am b/Makefile.am runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) [ -d test ] || $(LN_S) $(srcdir)/test . -diff -uNr a/runsuite.c b/runsuite.c ---- a/runsuite.c 2016-06-07 12:04:14.000000000 +0200 -+++ b/runsuite.c 2018-03-20 08:27:57.478817247 +0100 -@@ -1162,6 +1162,7 @@ +diff --git a/runsuite.c b/runsuite.c +index d24b5ec3..f7ff2521 100644 +--- a/runsuite.c ++++ b/runsuite.c +@@ -1147,6 +1147,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { if (logfile != NULL) fclose(logfile); @@ -35,20 +55,19 @@ diff -uNr a/runsuite.c b/runsuite.c return(ret); } #else /* !SCHEMAS */ -diff -uNr a/runtest.c b/runtest.c ---- a/runtest.c 2017-11-13 22:00:17.000000000 +0100 -+++ b/runtest.c 2018-03-20 08:28:50.859047551 +0100 -@@ -4496,7 +4496,8 @@ - } - +diff --git a/runtest.c b/runtest.c +index ffa98d04..470f95cb 100644 +--- a/runtest.c ++++ b/runtest.c +@@ -4508,6 +4508,7 @@ launchTests(testDescPtr tst) { xmlCharEncCloseFunc(ebcdicHandler); -- -+ + xmlCharEncCloseFunc(eucJpHandler); + + printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc); return(err); } -@@ -4573,6 +4574,7 @@ +@@ -4588,6 +4589,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { xmlCleanupParser(); xmlMemoryDump(); @@ -56,10 +75,11 @@ diff -uNr a/runtest.c b/runtest.c return(ret); } -diff -uNr a/runxmlconf.c b/runxmlconf.c ---- a/runxmlconf.c 2016-06-07 12:04:14.000000000 +0200 -+++ b/runxmlconf.c 2018-03-20 08:29:17.944862893 +0100 -@@ -595,6 +595,7 @@ +diff --git a/runxmlconf.c b/runxmlconf.c +index 70f61017..e882b3a1 100644 +--- a/runxmlconf.c ++++ b/runxmlconf.c +@@ -595,6 +595,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { if (logfile != NULL) fclose(logfile); @@ -67,15 +87,15 @@ diff -uNr a/runxmlconf.c b/runxmlconf.c return(ret); } -diff -uNr a/testapi.c b/testapi.c ---- a/testapi.c 2018-01-25 07:39:15.000000000 +0100 -+++ b/testapi.c 2018-03-20 09:08:35.323980145 +0100 -@@ -1246,49 +1246,91 @@ +diff --git a/testapi.c b/testapi.c +index ff8b470d..52b51d78 100644 +--- a/testapi.c ++++ b/testapi.c +@@ -1246,49 +1246,91 @@ static int testlibxml2(void) { int test_ret = 0; -+ int ret = 0; - +- - test_ret += test_HTMLparser(); - test_ret += test_HTMLtree(); - test_ret += test_SAX2(); @@ -115,6 +135,8 @@ diff -uNr a/testapi.c b/testapi.c - test_ret += test_xpath(); - test_ret += test_xpathInternals(); - test_ret += test_xpointer(); ++ int ret = 0; ++ + test_ret += (ret = test_HTMLparser()); + printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL"); + test_ret += (ret = test_HTMLtree()); @@ -201,20 +223,11 @@ diff -uNr a/testapi.c b/testapi.c return(test_ret); } -diff -uNr a/testdict.c b/testdict.c ---- a/testdict.c 2016-06-07 12:04:14.000000000 +0200 -+++ b/testdict.c 2018-03-20 08:59:16.864275812 +0100 -@@ -440,5 +440,6 @@ - clean_strings(); - xmlCleanupParser(); - xmlMemoryDump(); -+ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL"); - return(ret); - } -diff -uNr a/testchar.c b/testchar.c ---- a/testchar.c 2016-06-07 12:04:14.000000000 +0200 -+++ b/testchar.c 2018-03-20 09:11:20.383573912 +0100 -@@ -23,7 +23,7 @@ +diff --git a/testchar.c b/testchar.c +index 6866a175..7bce0132 100644 +--- a/testchar.c ++++ b/testchar.c +@@ -23,7 +23,7 @@ static void errorHandler(void *unused, xmlErrorPtr err) { char document1[100] = "<doc>XXXX</doc>"; char document2[100] = "<doc foo='XXXX'/>"; @@ -223,7 +236,7 @@ diff -uNr a/testchar.c b/testchar.c int len, char *data, int forbid1, int forbid2) { int i; xmlDocPtr res; -@@ -37,33 +37,41 @@ +@@ -37,33 +37,41 @@ static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document, res = xmlReadMemory(document, len, "test", NULL, 0); if ((i == forbid1) || (i == forbid2)) { @@ -269,7 +282,7 @@ diff -uNr a/testchar.c b/testchar.c int len, char *data) { int i, j; xmlDocPtr res; -@@ -80,10 +88,12 @@ +@@ -80,10 +88,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, /* if first bit of first char is set, then second bit must too */ if ((i & 0x80) && ((i & 0x40) == 0)) { @@ -283,7 +296,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -91,10 +101,12 @@ +@@ -91,10 +101,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, * bits must be 10 */ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { @@ -297,7 +310,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -102,10 +114,12 @@ +@@ -102,10 +114,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, * than 0x80, i.e. one of bits 5 to 1 of i must be set */ else if ((i & 0x80) && ((i & 0x1E) == 0)) { @@ -311,7 +324,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -113,10 +127,12 @@ +@@ -113,10 +127,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, * at least 3 bytes, but we give only 2 ! */ else if ((i & 0xE0) == 0xE0) { @@ -325,7 +338,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -125,11 +141,13 @@ +@@ -125,11 +141,13 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, else if ((lastError != 0) || (res == NULL)) { fprintf(stderr, "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); @@ -339,7 +352,7 @@ diff -uNr a/testchar.c b/testchar.c } /** -@@ -141,9 +159,10 @@ +@@ -141,9 +159,10 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, * CDATA in text or in attribute values. */ @@ -351,7 +364,7 @@ diff -uNr a/testchar.c b/testchar.c /* * Set up a parsing context using the first document as -@@ -152,7 +171,7 @@ +@@ -152,7 +171,7 @@ static void testDocumentRanges(void) { ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { fprintf(stderr, "Failed to allocate parser context\n"); @@ -360,7 +373,7 @@ diff -uNr a/testchar.c b/testchar.c } printf("testing 1 byte char in document: 1"); -@@ -163,7 +182,7 @@ +@@ -163,7 +182,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 1 byte injection at beginning of area */ @@ -369,7 +382,7 @@ diff -uNr a/testchar.c b/testchar.c data, -1, -1); printf(" 2"); fflush(stdout); -@@ -172,7 +191,7 @@ +@@ -172,7 +191,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 1 byte injection at end of area */ @@ -378,7 +391,7 @@ diff -uNr a/testchar.c b/testchar.c data + 3, -1, -1); printf(" 3"); -@@ -183,7 +202,7 @@ +@@ -183,7 +202,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 1 byte injection at beginning of area */ @@ -387,7 +400,7 @@ diff -uNr a/testchar.c b/testchar.c data, '\'', -1); printf(" 4"); fflush(stdout); -@@ -192,7 +211,7 @@ +@@ -192,7 +211,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 1 byte injection at end of area */ @@ -396,7 +409,7 @@ diff -uNr a/testchar.c b/testchar.c data + 3, '\'', -1); printf(" done\n"); -@@ -204,7 +223,7 @@ +@@ -204,7 +223,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 2 byte injection at beginning of area */ @@ -405,7 +418,7 @@ diff -uNr a/testchar.c b/testchar.c data); printf(" 2"); fflush(stdout); -@@ -213,7 +232,7 @@ +@@ -213,7 +232,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 2 byte injection at end of area */ @@ -414,7 +427,7 @@ diff -uNr a/testchar.c b/testchar.c data + 2); printf(" 3"); -@@ -224,7 +243,7 @@ +@@ -224,7 +243,7 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 2 byte injection at beginning of area */ @@ -423,7 +436,7 @@ diff -uNr a/testchar.c b/testchar.c data); printf(" 4"); fflush(stdout); -@@ -233,14 +252,15 @@ +@@ -233,14 +252,15 @@ static void testDocumentRanges(void) { data[2] = ' '; data[3] = ' '; /* test 2 byte injection at end of area */ @@ -441,7 +454,7 @@ diff -uNr a/testchar.c b/testchar.c int i = 0; int len, c; -@@ -255,19 +275,25 @@ +@@ -255,19 +275,25 @@ static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) { c = xmlCurrentChar(ctxt, &len); if ((i == 0) || (i >= 0x80)) { /* we must see an error there */ @@ -470,7 +483,7 @@ diff -uNr a/testchar.c b/testchar.c int i, j; int len, c; -@@ -284,10 +310,12 @@ +@@ -284,10 +310,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { /* if first bit of first char is set, then second bit must too */ if ((i & 0x80) && ((i & 0x40) == 0)) { @@ -484,7 +497,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -295,10 +323,12 @@ +@@ -295,10 +323,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { * bits must be 10 */ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { @@ -498,7 +511,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -306,10 +336,12 @@ +@@ -306,10 +336,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { * than 0x80, i.e. one of bits 5 to 1 of i must be set */ else if ((i & 0x80) && ((i & 0x1E) == 0)) { @@ -512,7 +525,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -317,10 +349,12 @@ +@@ -317,10 +349,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { * at least 3 bytes, but we give only 2 ! */ else if ((i & 0xE0) == 0xE0) { @@ -526,7 +539,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -329,6 +363,7 @@ +@@ -329,6 +363,7 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { else if ((lastError != 0) || (len != 2)) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j); @@ -534,7 +547,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -338,12 +373,14 @@ +@@ -338,12 +373,14 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n", i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c); @@ -550,7 +563,7 @@ diff -uNr a/testchar.c b/testchar.c int i, j, k, K; int len, c; unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; -@@ -368,20 +405,24 @@ +@@ -368,20 +405,24 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { * at least 4 bytes, but we give only 3 ! */ if ((i & 0xF0) == 0xF0) { @@ -577,7 +590,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -390,10 +431,12 @@ +@@ -390,10 +431,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { * the 6th byte of data[1] must be set */ else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) { @@ -591,7 +604,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -401,10 +444,12 @@ +@@ -401,10 +444,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { */ else if (((value > 0xD7FF) && (value <0xE000)) || ((value > 0xFFFD) && (value <0x10000))) { @@ -605,7 +618,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -414,6 +459,7 @@ +@@ -414,6 +459,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", i, j, K); @@ -613,7 +626,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -423,13 +469,15 @@ +@@ -423,13 +469,15 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", i, j, data[2], value, c); @@ -630,7 +643,7 @@ diff -uNr a/testchar.c b/testchar.c int i, j, k, K, l, L; int len, c; unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; -@@ -458,10 +506,12 @@ +@@ -458,10 +506,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { * at least 5 bytes, but we give only 4 ! */ if ((i & 0xF8) == 0xF8) { @@ -644,7 +657,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -469,10 +519,12 @@ +@@ -469,10 +519,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { */ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) || ((L & 0xC0) != 0x80)) { @@ -658,7 +671,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -481,10 +533,12 @@ +@@ -481,10 +533,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { * the 6 or 5th byte of j must be set */ else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) { @@ -672,7 +685,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -493,10 +547,12 @@ +@@ -493,10 +547,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { else if (((value > 0xD7FF) && (value <0xE000)) || ((value > 0xFFFD) && (value <0x10000)) || (value > 0x10FFFF)) { @@ -686,7 +699,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -506,6 +562,7 @@ +@@ -506,6 +562,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", i, j, K); @@ -694,7 +707,7 @@ diff -uNr a/testchar.c b/testchar.c } /* -@@ -515,11 +572,13 @@ +@@ -515,11 +572,13 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { fprintf(stderr, "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", i, j, data[2], value, c); @@ -708,7 +721,7 @@ diff -uNr a/testchar.c b/testchar.c } /** -@@ -530,11 +589,12 @@ +@@ -530,11 +589,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { * cover the full range of UTF-8 chars accepted by XML-1.0 */ @@ -722,7 +735,7 @@ diff -uNr a/testchar.c b/testchar.c memset(data, 0, 5); -@@ -545,17 +605,19 @@ +@@ -545,17 +605,19 @@ static void testCharRanges(void) { ctxt = xmlNewParserCtxt(); if (ctxt == NULL) { fprintf(stderr, "Failed to allocate parser context\n"); @@ -743,7 +756,7 @@ diff -uNr a/testchar.c b/testchar.c goto error; } input->filename = NULL; -@@ -567,25 +629,28 @@ +@@ -567,25 +629,28 @@ static void testCharRanges(void) { printf("testing char range: 1"); fflush(stdout); @@ -776,7 +789,7 @@ diff -uNr a/testchar.c b/testchar.c /* * this initialize the library and check potential ABI mismatches * between the version it was compiled for and the actual shared -@@ -602,8 +667,9 @@ +@@ -602,8 +667,9 @@ int main(void) { /* * Run the tests */ @@ -788,20 +801,33 @@ diff -uNr a/testchar.c b/testchar.c /* * Cleanup function for the XML library. -diff -uNr a/testlimits.c b/testlimits.c ---- a/testlimits.c 2016-11-07 09:41:40.000000000 +0100 -+++ b/testlimits.c 2018-03-20 08:59:38.965581280 +0100 -@@ -1634,5 +1634,6 @@ +diff --git a/testdict.c b/testdict.c +index 40bebd05..114b9347 100644 +--- a/testdict.c ++++ b/testdict.c +@@ -440,5 +440,6 @@ int main(void) + clean_strings(); + xmlCleanupParser(); + xmlMemoryDump(); ++ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL"); + return(ret); + } +diff --git a/testlimits.c b/testlimits.c +index 059116a6..f0bee68d 100644 +--- a/testlimits.c ++++ b/testlimits.c +@@ -1634,5 +1634,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { xmlCleanupParser(); xmlMemoryDump(); + printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL"); return(ret); } -diff -uNr a/testrecurse.c b/testrecurse.c ---- a/testrecurse.c 2017-10-26 09:54:40.000000000 +0200 -+++ b/testrecurse.c 2018-03-20 09:00:46.781628749 +0100 -@@ -892,6 +892,7 @@ +diff --git a/testrecurse.c b/testrecurse.c +index 0cbe25a6..3ecadb40 100644 +--- a/testrecurse.c ++++ b/testrecurse.c +@@ -892,6 +892,7 @@ launchTests(testDescPtr tst) { err++; } } @@ -809,10 +835,13 @@ diff -uNr a/testrecurse.c b/testrecurse.c return(err); } -@@ -961,5 +962,6 @@ +@@ -961,5 +962,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { xmlCleanupParser(); xmlMemoryDump(); + printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL"); return(ret); } +-- +2.25.1 + |