diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2019-05-12 16:16:29 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-12 17:55:11 +0100 |
commit | 311f07ebe562933be27847fa6b083ffb50f77919 (patch) | |
tree | d0a7e4a6d231901d13f046087a041ce1a3037f72 | |
parent | 66d67b818a7bb172f9ab804f9cb5b8e5b9e577f5 (diff) | |
download | poky-311f07ebe562933be27847fa6b083ffb50f77919.tar.gz |
libxml2: upgrade 2.9.8 -> 2.9.9
- Drop backported fix-CVE-2017-8872.patch,
fix-CVE-2018-14404.patch and
0001-Fix-infinite-loop-in-LZMA-decompression.patch
(From OE-Core rev: dc51f92b2a6f2439fa93b9b0c1d8c4c13e884813)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch | 55 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch | 65 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch | 45 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch | 24 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/libxml-64bit.patch | 24 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch | 16 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch | 13 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2/runtest.patch | 204 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2_2.9.9.bb (renamed from meta/recipes-core/libxml/libxml2_2.9.8.bb) | 7 |
9 files changed, 172 insertions, 281 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 @@ | |||
1 | From 28a9dc642ffd759df1e48be247a114f440a6c16e Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
3 | Date: Mon, 30 Jul 2018 13:14:11 +0200 | ||
4 | Subject: [PATCH] Fix infinite loop in LZMA decompression | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Check the liblzma error code more thoroughly to avoid infinite loops. | ||
10 | |||
11 | Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13 | ||
12 | Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914 | ||
13 | |||
14 | This is CVE-2018-9251 and CVE-2018-14567. | ||
15 | |||
16 | Thanks to Dongliang Mu and Simon Wörner for the reports. | ||
17 | |||
18 | CVE: CVE-2018-9251 | ||
19 | CVE: CVE-2018-14567 | ||
20 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/2240fbf5912054af025fb6e01e26375100275e74] | ||
21 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
22 | --- | ||
23 | xzlib.c | 9 +++++++++ | ||
24 | 1 file changed, 9 insertions(+) | ||
25 | |||
26 | diff --git a/xzlib.c b/xzlib.c | ||
27 | index a839169..0ba88cf 100644 | ||
28 | --- a/xzlib.c | ||
29 | +++ b/xzlib.c | ||
30 | @@ -562,6 +562,10 @@ xz_decomp(xz_statep state) | ||
31 | "internal error: inflate stream corrupt"); | ||
32 | return -1; | ||
33 | } | ||
34 | + /* | ||
35 | + * FIXME: Remapping a couple of error codes and falling through | ||
36 | + * to the LZMA error handling looks fragile. | ||
37 | + */ | ||
38 | if (ret == Z_MEM_ERROR) | ||
39 | ret = LZMA_MEM_ERROR; | ||
40 | if (ret == Z_DATA_ERROR) | ||
41 | @@ -587,6 +591,11 @@ xz_decomp(xz_statep state) | ||
42 | xz_error(state, LZMA_PROG_ERROR, "compression error"); | ||
43 | return -1; | ||
44 | } | ||
45 | + if ((state->how != GZIP) && | ||
46 | + (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) { | ||
47 | + xz_error(state, ret, "lzma error"); | ||
48 | + return -1; | ||
49 | + } | ||
50 | } while (strm->avail_out && ret != LZMA_STREAM_END); | ||
51 | |||
52 | /* update available output and crc check value */ | ||
53 | -- | ||
54 | 2.7.4 | ||
55 | |||
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 42a4b0ed60..0000000000 --- a/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | CVE: CVE-2017-8872 | ||
3 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
4 | |||
5 | From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001 | ||
6 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
7 | Date: Tue, 11 Sep 2018 14:52:07 +0200 | ||
8 | Subject: [PATCH] Free input buffer in xmlHaltParser | ||
9 | |||
10 | This avoids miscalculation of available bytes. | ||
11 | |||
12 | Thanks to Yunho Kim for the report. | ||
13 | |||
14 | Closes: #26 | ||
15 | --- | ||
16 | parser.c | 5 +++++ | ||
17 | result/errors/759573.xml.err | 17 +++++++---------- | ||
18 | 2 files changed, 12 insertions(+), 10 deletions(-) | ||
19 | |||
20 | diff --git a/parser.c b/parser.c | ||
21 | index ca9fde2c..5813a664 100644 | ||
22 | --- a/parser.c | ||
23 | +++ b/parser.c | ||
24 | @@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) { | ||
25 | ctxt->input->free((xmlChar *) ctxt->input->base); | ||
26 | ctxt->input->free = NULL; | ||
27 | } | ||
28 | + if (ctxt->input->buf != NULL) { | ||
29 | + xmlFreeParserInputBuffer(ctxt->input->buf); | ||
30 | + ctxt->input->buf = NULL; | ||
31 | + } | ||
32 | ctxt->input->cur = BAD_CAST""; | ||
33 | + ctxt->input->length = 0; | ||
34 | ctxt->input->base = ctxt->input->cur; | ||
35 | ctxt->input->end = ctxt->input->cur; | ||
36 | } | ||
37 | diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err | ||
38 | index 554039f6..38ef5c40 100644 | ||
39 | --- a/result/errors/759573.xml.err | ||
40 | +++ b/result/errors/759573.xml.err | ||
41 | @@ -21,14 +21,11 @@ Entity: line 1: | ||
42 | ^ | ||
43 | ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
44 | |||
45 | -<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 | ||
46 | - ^ | ||
47 | + | ||
48 | +^ | ||
49 | ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated | ||
50 | -<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 | ||
51 | - ^ | ||
52 | -./test/errors/759573.xml:1: parser error : StartTag: invalid element name | ||
53 | -<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 | ||
54 | - ^ | ||
55 | -./test/errors/759573.xml:1: parser error : Extra content at the end of the document | ||
56 | -<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 | ||
57 | - ^ | ||
58 | + | ||
59 | +^ | ||
60 | +./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found | ||
61 | + | ||
62 | +^ | ||
63 | -- | ||
64 | 2.11.0 | ||
65 | |||
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 @@ | |||
1 | libxml2-2.9.8: Fix CVE-2018-14404 | ||
2 | |||
3 | [No upstream tracking] -- https://gitlab.gnome.org/GNOME/libxml2/issues/5 | ||
4 | -- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817 | ||
5 | -- https://bugzilla.redhat.com/show_bug.cgi?id=1595985 | ||
6 | |||
7 | xpath: Fix nullptr deref with XPath logic ops | ||
8 | |||
9 | If the XPath stack is corrupted, for example by a misbehaving extension | ||
10 | function, the "and" and "or" XPath operators could dereference NULL | ||
11 | pointers. Check that the XPath stack isn't empty and optimize the | ||
12 | logic operators slightly. | ||
13 | |||
14 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/a436374994c47b12d5de1b8b1d191a098fa23594] | ||
15 | CVE: CVE-2018-14404 | ||
16 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> | ||
17 | |||
18 | diff --git a/xpath.c b/xpath.c | ||
19 | index f440696..75cac5c 100644 | ||
20 | --- a/xpath.c | ||
21 | +++ b/xpath.c | ||
22 | @@ -13297,9 +13297,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) | ||
23 | return(0); | ||
24 | } | ||
25 | xmlXPathBooleanFunction(ctxt, 1); | ||
26 | - arg1 = valuePop(ctxt); | ||
27 | - arg1->boolval &= arg2->boolval; | ||
28 | - valuePush(ctxt, arg1); | ||
29 | + if (ctxt->value != NULL) | ||
30 | + ctxt->value->boolval &= arg2->boolval; | ||
31 | xmlXPathReleaseObject(ctxt->context, arg2); | ||
32 | return (total); | ||
33 | case XPATH_OP_OR: | ||
34 | @@ -13323,9 +13322,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) | ||
35 | return(0); | ||
36 | } | ||
37 | xmlXPathBooleanFunction(ctxt, 1); | ||
38 | - arg1 = valuePop(ctxt); | ||
39 | - arg1->boolval |= arg2->boolval; | ||
40 | - valuePush(ctxt, arg1); | ||
41 | + if (ctxt->value != NULL) | ||
42 | + ctxt->value->boolval |= arg2->boolval; | ||
43 | xmlXPathReleaseObject(ctxt->context, arg2); | ||
44 | return (total); | ||
45 | 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 @@ | |||
1 | Make sure that Makefile doesn't try to compile these tests again | 1 | From 395c0f53ec226aaabedb166e6b3a7f8590b95a5f Mon Sep 17 00:00:00 2001 |
2 | on the target where the source dependencies won't be available. | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
3 | Date: Sat, 11 May 2019 20:39:15 +0800 | ||
4 | Subject: [PATCH] Make sure that Makefile doesn't try to compile these tests | ||
5 | again on the target where the source dependencies won't be available. | ||
3 | 6 | ||
4 | Upstream-Status: Inappropriate [cross-compile specific] | 7 | Upstream-Status: Inappropriate [cross-compile specific] |
5 | 8 | ||
6 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | 9 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> |
7 | 10 | ||
8 | Index: libxml2-2.9.7/Makefile.am | 11 | Rebase to 2.9.9 |
9 | =================================================================== | 12 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
10 | --- libxml2-2.9.7.orig/Makefile.am | 13 | --- |
11 | +++ libxml2-2.9.7/Makefile.am | 14 | Makefile.am | 3 +-- |
15 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/Makefile.am b/Makefile.am | ||
18 | index 8f4e43d..5edb930 100644 | ||
19 | --- a/Makefile.am | ||
20 | +++ b/Makefile.am | ||
12 | @@ -211,8 +211,7 @@ install-ptest: | 21 | @@ -211,8 +211,7 @@ install-ptest: |
13 | sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile | 22 | sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile |
14 | $(MAKE) -C python install-ptest | 23 | $(MAKE) -C python install-ptest |
@@ -19,3 +28,6 @@ Index: libxml2-2.9.7/Makefile.am | |||
19 | [ -d test ] || $(LN_S) $(srcdir)/test . | 28 | [ -d test ] || $(LN_S) $(srcdir)/test . |
20 | [ -d result ] || $(LN_S) $(srcdir)/result . | 29 | [ -d result ] || $(LN_S) $(srcdir)/result . |
21 | $(CHECKER) ./runtest$(EXEEXT) && \ | 30 | $(CHECKER) ./runtest$(EXEEXT) && \ |
31 | -- | ||
32 | 2.7.4 | ||
33 | |||
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 @@ | |||
1 | Upstream-Status: Backport [from debian: bugs.debian.org/439843] | 1 | From 056b14345b1abd76a761ab14538f1bc21302781a Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Sat, 11 May 2019 20:26:51 +0800 | ||
4 | Subject: [PATCH] libxml 64bit | ||
2 | 5 | ||
6 | Upstream-Status: Backport [from debian: bugs.debian.org/439843] | ||
7 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | --- | 8 | --- |
4 | libxml.h | 3 +++ | 9 | libxml.h | 3 +++ |
5 | 1 file changed, 3 insertions(+) | 10 | 1 file changed, 3 insertions(+) |
6 | 11 | ||
7 | --- libxml2-2.6.29.orig/libxml.h | 12 | diff --git a/libxml.h b/libxml.h |
8 | +++ libxml2-2.6.29/libxml.h | 13 | index 64e30f7..4e80d90 100644 |
9 | @@ -11,10 +11,13 @@ | 14 | --- a/libxml.h |
10 | 15 | +++ b/libxml.h | |
11 | #ifndef NO_LARGEFILE_SOURCE | 16 | @@ -15,6 +15,9 @@ |
12 | #ifndef _LARGEFILE_SOURCE | 17 | #ifndef _LARGEFILE_SOURCE |
13 | #define _LARGEFILE_SOURCE | 18 | #define _LARGEFILE_SOURCE |
14 | #endif | 19 | #endif |
@@ -18,5 +23,6 @@ Upstream-Status: Backport [from debian: bugs.debian.org/439843] | |||
18 | #ifndef _FILE_OFFSET_BITS | 23 | #ifndef _FILE_OFFSET_BITS |
19 | #define _FILE_OFFSET_BITS 64 | 24 | #define _FILE_OFFSET_BITS 64 |
20 | #endif | 25 | #endif |
21 | #endif | 26 | -- |
22 | 27 | 2.7.4 | |
28 | |||
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..e6998f6e68 100644 --- a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch +++ b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch | |||
@@ -1,11 +1,20 @@ | |||
1 | AM_PATH_XML2 uses xml-config which we disable through | 1 | From 43edc9a445ed66cceb7533eadeef242940b4592c Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Sat, 11 May 2019 20:37:12 +0800 | ||
4 | Subject: [PATCH] AM_PATH_XML2 uses xml-config which we disable through | ||
2 | binconfig-disabled.bbclass, so port it to use pkg-config instead. | 5 | binconfig-disabled.bbclass, so port it to use pkg-config instead. |
3 | 6 | ||
4 | Upstream-Status: Pending | 7 | Upstream-Status: Pending |
5 | Signed-off-by: Ross Burton <ross.burton@intel.com> | 8 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
6 | 9 | ||
10 | Rebase to 2.9.9 | ||
11 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
12 | --- | ||
13 | libxml.m4 | 186 ++------------------------------------------------------------ | ||
14 | 1 file changed, 5 insertions(+), 181 deletions(-) | ||
15 | |||
7 | diff --git a/libxml.m4 b/libxml.m4 | 16 | diff --git a/libxml.m4 b/libxml.m4 |
8 | index 68cd824..5fa0a9b 100644 | 17 | index 2d7a6f5..1c53585 100644 |
9 | --- a/libxml.m4 | 18 | --- a/libxml.m4 |
10 | +++ b/libxml.m4 | 19 | +++ b/libxml.m4 |
11 | @@ -1,188 +1,12 @@ | 20 | @@ -1,188 +1,12 @@ |
@@ -202,3 +211,6 @@ index 68cd824..5fa0a9b 100644 | |||
202 | - AC_SUBST(XML_LIBS) | 211 | - AC_SUBST(XML_LIBS) |
203 | - rm -f conf.xmltest | 212 | - rm -f conf.xmltest |
204 | ]) | 213 | ]) |
214 | -- | ||
215 | 2.7.4 | ||
216 | |||
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 @@ | |||
1 | Allow us to pass in PYTHON_SITE_PACKAGES | 1 | From b038c3452667ed17ddb0e791cd7bdc7f8774ac29 Mon Sep 17 00:00:00 2001 |
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Sat, 11 May 2019 20:35:20 +0800 | ||
4 | Subject: [PATCH] Allow us to pass in PYTHON_SITE_PACKAGES | ||
2 | 5 | ||
3 | The python binary used when building for nativesdk doesn't give us the | 6 | The python binary used when building for nativesdk doesn't give us the |
4 | correct path here so we need to be able to specify it ourselves. | 7 | 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. | |||
6 | Upstream-Status: Inappropriate [config] | 9 | Upstream-Status: Inappropriate [config] |
7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | 10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
8 | 11 | ||
9 | Rebase to 2.9.2 | 12 | Rebase to 2.9.9 |
13 | |||
10 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 14 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
11 | --- | 15 | --- |
12 | configure.ac | 3 ++- | 16 | configure.ac | 3 ++- |
13 | 1 file changed, 2 insertions(+), 1 deletion(-) | 17 | 1 file changed, 2 insertions(+), 1 deletion(-) |
14 | 18 | ||
15 | diff --git a/configure.ac b/configure.ac | 19 | diff --git a/configure.ac b/configure.ac |
20 | index ca911f3..3bbd654 100644 | ||
16 | --- a/configure.ac | 21 | --- a/configure.ac |
17 | +++ b/configure.ac | 22 | +++ b/configure.ac |
18 | @@ -813,7 +813,8 @@ dnl | 23 | @@ -808,7 +808,8 @@ dnl |
19 | 24 | ||
20 | PYTHON_VERSION= | 25 | PYTHON_VERSION= |
21 | PYTHON_INCLUDES= | 26 | PYTHON_INCLUDES= |
@@ -26,5 +31,5 @@ diff --git a/configure.ac b/configure.ac | |||
26 | pythondir= | 31 | pythondir= |
27 | if test "$with_python" != "no" ; then | 32 | if test "$with_python" != "no" ; then |
28 | -- | 33 | -- |
29 | 1.9.1 | 34 | 2.7.4 |
30 | 35 | ||
diff --git a/meta/recipes-core/libxml/libxml2/runtest.patch b/meta/recipes-core/libxml/libxml2/runtest.patch index 544dc05834..0dbb353c0f 100644 --- a/meta/recipes-core/libxml/libxml2/runtest.patch +++ b/meta/recipes-core/libxml/libxml2/runtest.patch | |||
@@ -1,14 +1,28 @@ | |||
1 | Add 'install-ptest' rule. | 1 | Add 'install-ptest' rule. Print a standard result line for |
2 | Print a standard result line for each test. | 2 | each test. |
3 | 3 | ||
4 | Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> | 4 | Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> |
5 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> | 5 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> |
6 | Upstream-Status: Backport | 6 | Upstream-Status: Backport |
7 | 7 | ||
8 | diff -uNr a/Makefile.am b/Makefile.am | 8 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
9 | --- a/Makefile.am 2017-12-02 09:58:10.000000000 +0100 | 9 | --- |
10 | +++ b/Makefile.am 2018-03-20 08:27:34.360505864 +0100 | 10 | Makefile.am | 9 ++++ |
11 | @@ -202,6 +202,15 @@ | 11 | runsuite.c | 1 + |
12 | runtest.c | 2 + | ||
13 | runxmlconf.c | 1 + | ||
14 | testapi.c | 122 ++++++++++++++++++++++++++++++--------------- | ||
15 | testchar.c | 156 +++++++++++++++++++++++++++++++++++++++++----------------- | ||
16 | testdict.c | 1 + | ||
17 | testlimits.c | 1 + | ||
18 | testrecurse.c | 2 + | ||
19 | 9 files changed, 210 insertions(+), 85 deletions(-) | ||
20 | |||
21 | diff --git a/Makefile.am b/Makefile.am | ||
22 | index 9c630be..7cfd04b 100644 | ||
23 | --- a/Makefile.am | ||
24 | +++ b/Makefile.am | ||
25 | @@ -202,6 +202,15 @@ runxmlconf_LDADD= $(LDADDS) | ||
12 | #testOOM_DEPENDENCIES = $(DEPS) | 26 | #testOOM_DEPENDENCIES = $(DEPS) |
13 | #testOOM_LDADD= $(LDADDS) | 27 | #testOOM_LDADD= $(LDADDS) |
14 | 28 | ||
@@ -24,10 +38,11 @@ diff -uNr a/Makefile.am b/Makefile.am | |||
24 | runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ | 38 | runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ |
25 | testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) | 39 | testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) |
26 | [ -d test ] || $(LN_S) $(srcdir)/test . | 40 | [ -d test ] || $(LN_S) $(srcdir)/test . |
27 | diff -uNr a/runsuite.c b/runsuite.c | 41 | diff --git a/runsuite.c b/runsuite.c |
28 | --- a/runsuite.c 2016-06-07 12:04:14.000000000 +0200 | 42 | index aaab13e..9ba2c5d 100644 |
29 | +++ b/runsuite.c 2018-03-20 08:27:57.478817247 +0100 | 43 | --- a/runsuite.c |
30 | @@ -1162,6 +1162,7 @@ | 44 | +++ b/runsuite.c |
45 | @@ -1162,6 +1162,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | ||
31 | 46 | ||
32 | if (logfile != NULL) | 47 | if (logfile != NULL) |
33 | fclose(logfile); | 48 | fclose(logfile); |
@@ -35,20 +50,19 @@ diff -uNr a/runsuite.c b/runsuite.c | |||
35 | return(ret); | 50 | return(ret); |
36 | } | 51 | } |
37 | #else /* !SCHEMAS */ | 52 | #else /* !SCHEMAS */ |
38 | diff -uNr a/runtest.c b/runtest.c | 53 | diff --git a/runtest.c b/runtest.c |
39 | --- a/runtest.c 2017-11-13 22:00:17.000000000 +0100 | 54 | index addda5c..8ba5d59 100644 |
40 | +++ b/runtest.c 2018-03-20 08:28:50.859047551 +0100 | 55 | --- a/runtest.c |
41 | @@ -4496,7 +4496,8 @@ | 56 | +++ b/runtest.c |
42 | } | 57 | @@ -4501,6 +4501,7 @@ launchTests(testDescPtr tst) { |
43 | |||
44 | xmlCharEncCloseFunc(ebcdicHandler); | 58 | xmlCharEncCloseFunc(ebcdicHandler); |
45 | - | 59 | xmlCharEncCloseFunc(eucJpHandler); |
46 | + | 60 | |
47 | + printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc); | 61 | + printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc); |
48 | return(err); | 62 | return(err); |
49 | } | 63 | } |
50 | 64 | ||
51 | @@ -4573,6 +4574,7 @@ | 65 | @@ -4577,6 +4578,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { |
52 | xmlCleanupParser(); | 66 | xmlCleanupParser(); |
53 | xmlMemoryDump(); | 67 | xmlMemoryDump(); |
54 | 68 | ||
@@ -56,10 +70,11 @@ diff -uNr a/runtest.c b/runtest.c | |||
56 | return(ret); | 70 | return(ret); |
57 | } | 71 | } |
58 | 72 | ||
59 | diff -uNr a/runxmlconf.c b/runxmlconf.c | 73 | diff --git a/runxmlconf.c b/runxmlconf.c |
60 | --- a/runxmlconf.c 2016-06-07 12:04:14.000000000 +0200 | 74 | index cef20f4..4f291fb 100644 |
61 | +++ b/runxmlconf.c 2018-03-20 08:29:17.944862893 +0100 | 75 | --- a/runxmlconf.c |
62 | @@ -595,6 +595,7 @@ | 76 | +++ b/runxmlconf.c |
77 | @@ -595,6 +595,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | ||
63 | 78 | ||
64 | if (logfile != NULL) | 79 | if (logfile != NULL) |
65 | fclose(logfile); | 80 | fclose(logfile); |
@@ -67,15 +82,15 @@ diff -uNr a/runxmlconf.c b/runxmlconf.c | |||
67 | return(ret); | 82 | return(ret); |
68 | } | 83 | } |
69 | 84 | ||
70 | diff -uNr a/testapi.c b/testapi.c | 85 | diff --git a/testapi.c b/testapi.c |
71 | --- a/testapi.c 2018-01-25 07:39:15.000000000 +0100 | 86 | index 4a751e2..7ccc066 100644 |
72 | +++ b/testapi.c 2018-03-20 09:08:35.323980145 +0100 | 87 | --- a/testapi.c |
73 | @@ -1246,49 +1246,91 @@ | 88 | +++ b/testapi.c |
89 | @@ -1246,49 +1246,91 @@ static int | ||
74 | testlibxml2(void) | 90 | testlibxml2(void) |
75 | { | 91 | { |
76 | int test_ret = 0; | 92 | int test_ret = 0; |
77 | + int ret = 0; | 93 | - |
78 | |||
79 | - test_ret += test_HTMLparser(); | 94 | - test_ret += test_HTMLparser(); |
80 | - test_ret += test_HTMLtree(); | 95 | - test_ret += test_HTMLtree(); |
81 | - test_ret += test_SAX2(); | 96 | - test_ret += test_SAX2(); |
@@ -115,6 +130,8 @@ diff -uNr a/testapi.c b/testapi.c | |||
115 | - test_ret += test_xpath(); | 130 | - test_ret += test_xpath(); |
116 | - test_ret += test_xpathInternals(); | 131 | - test_ret += test_xpathInternals(); |
117 | - test_ret += test_xpointer(); | 132 | - test_ret += test_xpointer(); |
133 | + int ret = 0; | ||
134 | + | ||
118 | + test_ret += (ret = test_HTMLparser()); | 135 | + test_ret += (ret = test_HTMLparser()); |
119 | + printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL"); | 136 | + printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL"); |
120 | + test_ret += (ret = test_HTMLtree()); | 137 | + test_ret += (ret = test_HTMLtree()); |
@@ -201,20 +218,11 @@ diff -uNr a/testapi.c b/testapi.c | |||
201 | return(test_ret); | 218 | return(test_ret); |
202 | } | 219 | } |
203 | 220 | ||
204 | diff -uNr a/testdict.c b/testdict.c | 221 | diff --git a/testchar.c b/testchar.c |
205 | --- a/testdict.c 2016-06-07 12:04:14.000000000 +0200 | 222 | index 0d08792..f555d3b 100644 |
206 | +++ b/testdict.c 2018-03-20 08:59:16.864275812 +0100 | 223 | --- a/testchar.c |
207 | @@ -440,5 +440,6 @@ | 224 | +++ b/testchar.c |
208 | clean_strings(); | 225 | @@ -23,7 +23,7 @@ static void errorHandler(void *unused, xmlErrorPtr err) { |
209 | xmlCleanupParser(); | ||
210 | xmlMemoryDump(); | ||
211 | + printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL"); | ||
212 | return(ret); | ||
213 | } | ||
214 | diff -uNr a/testchar.c b/testchar.c | ||
215 | --- a/testchar.c 2016-06-07 12:04:14.000000000 +0200 | ||
216 | +++ b/testchar.c 2018-03-20 09:11:20.383573912 +0100 | ||
217 | @@ -23,7 +23,7 @@ | ||
218 | char document1[100] = "<doc>XXXX</doc>"; | 226 | char document1[100] = "<doc>XXXX</doc>"; |
219 | char document2[100] = "<doc foo='XXXX'/>"; | 227 | char document2[100] = "<doc foo='XXXX'/>"; |
220 | 228 | ||
@@ -223,7 +231,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
223 | int len, char *data, int forbid1, int forbid2) { | 231 | int len, char *data, int forbid1, int forbid2) { |
224 | int i; | 232 | int i; |
225 | xmlDocPtr res; | 233 | xmlDocPtr res; |
226 | @@ -37,33 +37,41 @@ | 234 | @@ -37,33 +37,41 @@ static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document, |
227 | res = xmlReadMemory(document, len, "test", NULL, 0); | 235 | res = xmlReadMemory(document, len, "test", NULL, 0); |
228 | 236 | ||
229 | if ((i == forbid1) || (i == forbid2)) { | 237 | if ((i == forbid1) || (i == forbid2)) { |
@@ -269,7 +277,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
269 | int len, char *data) { | 277 | int len, char *data) { |
270 | int i, j; | 278 | int i, j; |
271 | xmlDocPtr res; | 279 | xmlDocPtr res; |
272 | @@ -80,10 +88,12 @@ | 280 | @@ -80,10 +88,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
273 | 281 | ||
274 | /* if first bit of first char is set, then second bit must too */ | 282 | /* if first bit of first char is set, then second bit must too */ |
275 | if ((i & 0x80) && ((i & 0x40) == 0)) { | 283 | if ((i & 0x80) && ((i & 0x40) == 0)) { |
@@ -283,7 +291,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
283 | } | 291 | } |
284 | 292 | ||
285 | /* | 293 | /* |
286 | @@ -91,10 +101,12 @@ | 294 | @@ -91,10 +101,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
287 | * bits must be 10 | 295 | * bits must be 10 |
288 | */ | 296 | */ |
289 | else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { | 297 | else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { |
@@ -297,7 +305,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
297 | } | 305 | } |
298 | 306 | ||
299 | /* | 307 | /* |
300 | @@ -102,10 +114,12 @@ | 308 | @@ -102,10 +114,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
301 | * than 0x80, i.e. one of bits 5 to 1 of i must be set | 309 | * than 0x80, i.e. one of bits 5 to 1 of i must be set |
302 | */ | 310 | */ |
303 | else if ((i & 0x80) && ((i & 0x1E) == 0)) { | 311 | else if ((i & 0x80) && ((i & 0x1E) == 0)) { |
@@ -311,7 +319,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
311 | } | 319 | } |
312 | 320 | ||
313 | /* | 321 | /* |
314 | @@ -113,10 +127,12 @@ | 322 | @@ -113,10 +127,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
315 | * at least 3 bytes, but we give only 2 ! | 323 | * at least 3 bytes, but we give only 2 ! |
316 | */ | 324 | */ |
317 | else if ((i & 0xE0) == 0xE0) { | 325 | else if ((i & 0xE0) == 0xE0) { |
@@ -325,7 +333,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
325 | } | 333 | } |
326 | 334 | ||
327 | /* | 335 | /* |
328 | @@ -125,11 +141,13 @@ | 336 | @@ -125,11 +141,13 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
329 | else if ((lastError != 0) || (res == NULL)) { | 337 | else if ((lastError != 0) || (res == NULL)) { |
330 | fprintf(stderr, | 338 | fprintf(stderr, |
331 | "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); | 339 | "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); |
@@ -339,7 +347,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
339 | } | 347 | } |
340 | 348 | ||
341 | /** | 349 | /** |
342 | @@ -141,9 +159,10 @@ | 350 | @@ -141,9 +159,10 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, |
343 | * CDATA in text or in attribute values. | 351 | * CDATA in text or in attribute values. |
344 | */ | 352 | */ |
345 | 353 | ||
@@ -351,7 +359,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
351 | 359 | ||
352 | /* | 360 | /* |
353 | * Set up a parsing context using the first document as | 361 | * Set up a parsing context using the first document as |
354 | @@ -152,7 +171,7 @@ | 362 | @@ -152,7 +171,7 @@ static void testDocumentRanges(void) { |
355 | ctxt = xmlNewParserCtxt(); | 363 | ctxt = xmlNewParserCtxt(); |
356 | if (ctxt == NULL) { | 364 | if (ctxt == NULL) { |
357 | fprintf(stderr, "Failed to allocate parser context\n"); | 365 | fprintf(stderr, "Failed to allocate parser context\n"); |
@@ -360,7 +368,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
360 | } | 368 | } |
361 | 369 | ||
362 | printf("testing 1 byte char in document: 1"); | 370 | printf("testing 1 byte char in document: 1"); |
363 | @@ -163,7 +182,7 @@ | 371 | @@ -163,7 +182,7 @@ static void testDocumentRanges(void) { |
364 | data[2] = ' '; | 372 | data[2] = ' '; |
365 | data[3] = ' '; | 373 | data[3] = ' '; |
366 | /* test 1 byte injection at beginning of area */ | 374 | /* test 1 byte injection at beginning of area */ |
@@ -369,7 +377,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
369 | data, -1, -1); | 377 | data, -1, -1); |
370 | printf(" 2"); | 378 | printf(" 2"); |
371 | fflush(stdout); | 379 | fflush(stdout); |
372 | @@ -172,7 +191,7 @@ | 380 | @@ -172,7 +191,7 @@ static void testDocumentRanges(void) { |
373 | data[2] = ' '; | 381 | data[2] = ' '; |
374 | data[3] = ' '; | 382 | data[3] = ' '; |
375 | /* test 1 byte injection at end of area */ | 383 | /* test 1 byte injection at end of area */ |
@@ -378,7 +386,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
378 | data + 3, -1, -1); | 386 | data + 3, -1, -1); |
379 | 387 | ||
380 | printf(" 3"); | 388 | printf(" 3"); |
381 | @@ -183,7 +202,7 @@ | 389 | @@ -183,7 +202,7 @@ static void testDocumentRanges(void) { |
382 | data[2] = ' '; | 390 | data[2] = ' '; |
383 | data[3] = ' '; | 391 | data[3] = ' '; |
384 | /* test 1 byte injection at beginning of area */ | 392 | /* test 1 byte injection at beginning of area */ |
@@ -387,7 +395,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
387 | data, '\'', -1); | 395 | data, '\'', -1); |
388 | printf(" 4"); | 396 | printf(" 4"); |
389 | fflush(stdout); | 397 | fflush(stdout); |
390 | @@ -192,7 +211,7 @@ | 398 | @@ -192,7 +211,7 @@ static void testDocumentRanges(void) { |
391 | data[2] = ' '; | 399 | data[2] = ' '; |
392 | data[3] = ' '; | 400 | data[3] = ' '; |
393 | /* test 1 byte injection at end of area */ | 401 | /* test 1 byte injection at end of area */ |
@@ -396,7 +404,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
396 | data + 3, '\'', -1); | 404 | data + 3, '\'', -1); |
397 | printf(" done\n"); | 405 | printf(" done\n"); |
398 | 406 | ||
399 | @@ -204,7 +223,7 @@ | 407 | @@ -204,7 +223,7 @@ static void testDocumentRanges(void) { |
400 | data[2] = ' '; | 408 | data[2] = ' '; |
401 | data[3] = ' '; | 409 | data[3] = ' '; |
402 | /* test 2 byte injection at beginning of area */ | 410 | /* test 2 byte injection at beginning of area */ |
@@ -405,7 +413,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
405 | data); | 413 | data); |
406 | printf(" 2"); | 414 | printf(" 2"); |
407 | fflush(stdout); | 415 | fflush(stdout); |
408 | @@ -213,7 +232,7 @@ | 416 | @@ -213,7 +232,7 @@ static void testDocumentRanges(void) { |
409 | data[2] = ' '; | 417 | data[2] = ' '; |
410 | data[3] = ' '; | 418 | data[3] = ' '; |
411 | /* test 2 byte injection at end of area */ | 419 | /* test 2 byte injection at end of area */ |
@@ -414,7 +422,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
414 | data + 2); | 422 | data + 2); |
415 | 423 | ||
416 | printf(" 3"); | 424 | printf(" 3"); |
417 | @@ -224,7 +243,7 @@ | 425 | @@ -224,7 +243,7 @@ static void testDocumentRanges(void) { |
418 | data[2] = ' '; | 426 | data[2] = ' '; |
419 | data[3] = ' '; | 427 | data[3] = ' '; |
420 | /* test 2 byte injection at beginning of area */ | 428 | /* test 2 byte injection at beginning of area */ |
@@ -423,7 +431,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
423 | data); | 431 | data); |
424 | printf(" 4"); | 432 | printf(" 4"); |
425 | fflush(stdout); | 433 | fflush(stdout); |
426 | @@ -233,14 +252,15 @@ | 434 | @@ -233,14 +252,15 @@ static void testDocumentRanges(void) { |
427 | data[2] = ' '; | 435 | data[2] = ' '; |
428 | data[3] = ' '; | 436 | data[3] = ' '; |
429 | /* test 2 byte injection at end of area */ | 437 | /* test 2 byte injection at end of area */ |
@@ -441,7 +449,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
441 | int i = 0; | 449 | int i = 0; |
442 | int len, c; | 450 | int len, c; |
443 | 451 | ||
444 | @@ -255,19 +275,25 @@ | 452 | @@ -255,19 +275,25 @@ static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) { |
445 | c = xmlCurrentChar(ctxt, &len); | 453 | c = xmlCurrentChar(ctxt, &len); |
446 | if ((i == 0) || (i >= 0x80)) { | 454 | if ((i == 0) || (i >= 0x80)) { |
447 | /* we must see an error there */ | 455 | /* we must see an error there */ |
@@ -470,7 +478,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
470 | int i, j; | 478 | int i, j; |
471 | int len, c; | 479 | int len, c; |
472 | 480 | ||
473 | @@ -284,10 +310,12 @@ | 481 | @@ -284,10 +310,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
474 | 482 | ||
475 | /* if first bit of first char is set, then second bit must too */ | 483 | /* if first bit of first char is set, then second bit must too */ |
476 | if ((i & 0x80) && ((i & 0x40) == 0)) { | 484 | if ((i & 0x80) && ((i & 0x40) == 0)) { |
@@ -484,7 +492,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
484 | } | 492 | } |
485 | 493 | ||
486 | /* | 494 | /* |
487 | @@ -295,10 +323,12 @@ | 495 | @@ -295,10 +323,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
488 | * bits must be 10 | 496 | * bits must be 10 |
489 | */ | 497 | */ |
490 | else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { | 498 | else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { |
@@ -498,7 +506,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
498 | } | 506 | } |
499 | 507 | ||
500 | /* | 508 | /* |
501 | @@ -306,10 +336,12 @@ | 509 | @@ -306,10 +336,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
502 | * than 0x80, i.e. one of bits 5 to 1 of i must be set | 510 | * than 0x80, i.e. one of bits 5 to 1 of i must be set |
503 | */ | 511 | */ |
504 | else if ((i & 0x80) && ((i & 0x1E) == 0)) { | 512 | else if ((i & 0x80) && ((i & 0x1E) == 0)) { |
@@ -512,7 +520,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
512 | } | 520 | } |
513 | 521 | ||
514 | /* | 522 | /* |
515 | @@ -317,10 +349,12 @@ | 523 | @@ -317,10 +349,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
516 | * at least 3 bytes, but we give only 2 ! | 524 | * at least 3 bytes, but we give only 2 ! |
517 | */ | 525 | */ |
518 | else if ((i & 0xE0) == 0xE0) { | 526 | else if ((i & 0xE0) == 0xE0) { |
@@ -526,7 +534,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
526 | } | 534 | } |
527 | 535 | ||
528 | /* | 536 | /* |
529 | @@ -329,6 +363,7 @@ | 537 | @@ -329,6 +363,7 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
530 | else if ((lastError != 0) || (len != 2)) { | 538 | else if ((lastError != 0) || (len != 2)) { |
531 | fprintf(stderr, | 539 | fprintf(stderr, |
532 | "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j); | 540 | "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j); |
@@ -534,7 +542,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
534 | } | 542 | } |
535 | 543 | ||
536 | /* | 544 | /* |
537 | @@ -338,12 +373,14 @@ | 545 | @@ -338,12 +373,14 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { |
538 | fprintf(stderr, | 546 | fprintf(stderr, |
539 | "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n", | 547 | "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n", |
540 | i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c); | 548 | i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c); |
@@ -550,7 +558,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
550 | int i, j, k, K; | 558 | int i, j, k, K; |
551 | int len, c; | 559 | int len, c; |
552 | unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; | 560 | unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; |
553 | @@ -368,20 +405,24 @@ | 561 | @@ -368,20 +405,24 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { |
554 | * at least 4 bytes, but we give only 3 ! | 562 | * at least 4 bytes, but we give only 3 ! |
555 | */ | 563 | */ |
556 | if ((i & 0xF0) == 0xF0) { | 564 | if ((i & 0xF0) == 0xF0) { |
@@ -577,7 +585,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
577 | } | 585 | } |
578 | 586 | ||
579 | /* | 587 | /* |
580 | @@ -390,10 +431,12 @@ | 588 | @@ -390,10 +431,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { |
581 | * the 6th byte of data[1] must be set | 589 | * the 6th byte of data[1] must be set |
582 | */ | 590 | */ |
583 | else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) { | 591 | else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) { |
@@ -591,7 +599,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
591 | } | 599 | } |
592 | 600 | ||
593 | /* | 601 | /* |
594 | @@ -401,10 +444,12 @@ | 602 | @@ -401,10 +444,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { |
595 | */ | 603 | */ |
596 | else if (((value > 0xD7FF) && (value <0xE000)) || | 604 | else if (((value > 0xD7FF) && (value <0xE000)) || |
597 | ((value > 0xFFFD) && (value <0x10000))) { | 605 | ((value > 0xFFFD) && (value <0x10000))) { |
@@ -605,7 +613,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
605 | } | 613 | } |
606 | 614 | ||
607 | /* | 615 | /* |
608 | @@ -414,6 +459,7 @@ | 616 | @@ -414,6 +459,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { |
609 | fprintf(stderr, | 617 | fprintf(stderr, |
610 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", | 618 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
611 | i, j, K); | 619 | i, j, K); |
@@ -613,7 +621,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
613 | } | 621 | } |
614 | 622 | ||
615 | /* | 623 | /* |
616 | @@ -423,13 +469,15 @@ | 624 | @@ -423,13 +469,15 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { |
617 | fprintf(stderr, | 625 | fprintf(stderr, |
618 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", | 626 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", |
619 | i, j, data[2], value, c); | 627 | i, j, data[2], value, c); |
@@ -630,7 +638,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
630 | int i, j, k, K, l, L; | 638 | int i, j, k, K, l, L; |
631 | int len, c; | 639 | int len, c; |
632 | unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; | 640 | unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; |
633 | @@ -458,10 +506,12 @@ | 641 | @@ -458,10 +506,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
634 | * at least 5 bytes, but we give only 4 ! | 642 | * at least 5 bytes, but we give only 4 ! |
635 | */ | 643 | */ |
636 | if ((i & 0xF8) == 0xF8) { | 644 | if ((i & 0xF8) == 0xF8) { |
@@ -644,7 +652,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
644 | } | 652 | } |
645 | 653 | ||
646 | /* | 654 | /* |
647 | @@ -469,10 +519,12 @@ | 655 | @@ -469,10 +519,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
648 | */ | 656 | */ |
649 | else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) || | 657 | else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) || |
650 | ((L & 0xC0) != 0x80)) { | 658 | ((L & 0xC0) != 0x80)) { |
@@ -658,7 +666,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
658 | } | 666 | } |
659 | 667 | ||
660 | /* | 668 | /* |
661 | @@ -481,10 +533,12 @@ | 669 | @@ -481,10 +533,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
662 | * the 6 or 5th byte of j must be set | 670 | * the 6 or 5th byte of j must be set |
663 | */ | 671 | */ |
664 | else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) { | 672 | else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) { |
@@ -672,7 +680,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
672 | } | 680 | } |
673 | 681 | ||
674 | /* | 682 | /* |
675 | @@ -493,10 +547,12 @@ | 683 | @@ -493,10 +547,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
676 | else if (((value > 0xD7FF) && (value <0xE000)) || | 684 | else if (((value > 0xD7FF) && (value <0xE000)) || |
677 | ((value > 0xFFFD) && (value <0x10000)) || | 685 | ((value > 0xFFFD) && (value <0x10000)) || |
678 | (value > 0x10FFFF)) { | 686 | (value > 0x10FFFF)) { |
@@ -686,7 +694,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
686 | } | 694 | } |
687 | 695 | ||
688 | /* | 696 | /* |
689 | @@ -506,6 +562,7 @@ | 697 | @@ -506,6 +562,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
690 | fprintf(stderr, | 698 | fprintf(stderr, |
691 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", | 699 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
692 | i, j, K); | 700 | i, j, K); |
@@ -694,7 +702,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
694 | } | 702 | } |
695 | 703 | ||
696 | /* | 704 | /* |
697 | @@ -515,11 +572,13 @@ | 705 | @@ -515,11 +572,13 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
698 | fprintf(stderr, | 706 | fprintf(stderr, |
699 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", | 707 | "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", |
700 | i, j, data[2], value, c); | 708 | i, j, data[2], value, c); |
@@ -708,7 +716,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
708 | } | 716 | } |
709 | 717 | ||
710 | /** | 718 | /** |
711 | @@ -530,11 +589,12 @@ | 719 | @@ -530,11 +589,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { |
712 | * cover the full range of UTF-8 chars accepted by XML-1.0 | 720 | * cover the full range of UTF-8 chars accepted by XML-1.0 |
713 | */ | 721 | */ |
714 | 722 | ||
@@ -722,7 +730,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
722 | 730 | ||
723 | memset(data, 0, 5); | 731 | memset(data, 0, 5); |
724 | 732 | ||
725 | @@ -545,17 +605,19 @@ | 733 | @@ -545,17 +605,19 @@ static void testCharRanges(void) { |
726 | ctxt = xmlNewParserCtxt(); | 734 | ctxt = xmlNewParserCtxt(); |
727 | if (ctxt == NULL) { | 735 | if (ctxt == NULL) { |
728 | fprintf(stderr, "Failed to allocate parser context\n"); | 736 | fprintf(stderr, "Failed to allocate parser context\n"); |
@@ -743,7 +751,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
743 | goto error; | 751 | goto error; |
744 | } | 752 | } |
745 | input->filename = NULL; | 753 | input->filename = NULL; |
746 | @@ -567,25 +629,28 @@ | 754 | @@ -567,25 +629,28 @@ static void testCharRanges(void) { |
747 | 755 | ||
748 | printf("testing char range: 1"); | 756 | printf("testing char range: 1"); |
749 | fflush(stdout); | 757 | fflush(stdout); |
@@ -776,7 +784,7 @@ diff -uNr a/testchar.c b/testchar.c | |||
776 | /* | 784 | /* |
777 | * this initialize the library and check potential ABI mismatches | 785 | * this initialize the library and check potential ABI mismatches |
778 | * between the version it was compiled for and the actual shared | 786 | * between the version it was compiled for and the actual shared |
779 | @@ -602,8 +667,9 @@ | 787 | @@ -602,8 +667,9 @@ int main(void) { |
780 | /* | 788 | /* |
781 | * Run the tests | 789 | * Run the tests |
782 | */ | 790 | */ |
@@ -788,20 +796,33 @@ diff -uNr a/testchar.c b/testchar.c | |||
788 | 796 | ||
789 | /* | 797 | /* |
790 | * Cleanup function for the XML library. | 798 | * Cleanup function for the XML library. |
791 | diff -uNr a/testlimits.c b/testlimits.c | 799 | diff --git a/testdict.c b/testdict.c |
792 | --- a/testlimits.c 2016-11-07 09:41:40.000000000 +0100 | 800 | index 40bebd0..114b934 100644 |
793 | +++ b/testlimits.c 2018-03-20 08:59:38.965581280 +0100 | 801 | --- a/testdict.c |
794 | @@ -1634,5 +1634,6 @@ | 802 | +++ b/testdict.c |
803 | @@ -440,5 +440,6 @@ int main(void) | ||
804 | clean_strings(); | ||
805 | xmlCleanupParser(); | ||
806 | xmlMemoryDump(); | ||
807 | + printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL"); | ||
808 | return(ret); | ||
809 | } | ||
810 | diff --git a/testlimits.c b/testlimits.c | ||
811 | index 68c94db..1584434 100644 | ||
812 | --- a/testlimits.c | ||
813 | +++ b/testlimits.c | ||
814 | @@ -1634,5 +1634,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | ||
795 | xmlCleanupParser(); | 815 | xmlCleanupParser(); |
796 | xmlMemoryDump(); | 816 | xmlMemoryDump(); |
797 | 817 | ||
798 | + printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL"); | 818 | + printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL"); |
799 | return(ret); | 819 | return(ret); |
800 | } | 820 | } |
801 | diff -uNr a/testrecurse.c b/testrecurse.c | 821 | diff --git a/testrecurse.c b/testrecurse.c |
802 | --- a/testrecurse.c 2017-10-26 09:54:40.000000000 +0200 | 822 | index f95ae1c..74c8f8b 100644 |
803 | +++ b/testrecurse.c 2018-03-20 09:00:46.781628749 +0100 | 823 | --- a/testrecurse.c |
804 | @@ -892,6 +892,7 @@ | 824 | +++ b/testrecurse.c |
825 | @@ -892,6 +892,7 @@ launchTests(testDescPtr tst) { | ||
805 | err++; | 826 | err++; |
806 | } | 827 | } |
807 | } | 828 | } |
@@ -809,10 +830,13 @@ diff -uNr a/testrecurse.c b/testrecurse.c | |||
809 | return(err); | 830 | return(err); |
810 | } | 831 | } |
811 | 832 | ||
812 | @@ -961,5 +962,6 @@ | 833 | @@ -961,5 +962,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { |
813 | xmlCleanupParser(); | 834 | xmlCleanupParser(); |
814 | xmlMemoryDump(); | 835 | xmlMemoryDump(); |
815 | 836 | ||
816 | + printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL"); | 837 | + printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL"); |
817 | return(ret); | 838 | return(ret); |
818 | } | 839 | } |
840 | -- | ||
841 | 2.7.4 | ||
842 | |||
diff --git a/meta/recipes-core/libxml/libxml2_2.9.8.bb b/meta/recipes-core/libxml/libxml2_2.9.9.bb index 62643bc764..c38f883e44 100644 --- a/meta/recipes-core/libxml/libxml2_2.9.8.bb +++ b/meta/recipes-core/libxml/libxml2_2.9.9.bb | |||
@@ -20,13 +20,10 @@ SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \ | |||
20 | file://libxml-m4-use-pkgconfig.patch \ | 20 | file://libxml-m4-use-pkgconfig.patch \ |
21 | file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \ | 21 | file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \ |
22 | file://fix-execution-of-ptests.patch \ | 22 | file://fix-execution-of-ptests.patch \ |
23 | file://fix-CVE-2017-8872.patch \ | ||
24 | file://fix-CVE-2018-14404.patch \ | ||
25 | file://0001-Fix-infinite-loop-in-LZMA-decompression.patch \ | ||
26 | " | 23 | " |
27 | 24 | ||
28 | SRC_URI[libtar.md5sum] = "b786e353e2aa1b872d70d5d1ca0c740d" | 25 | SRC_URI[libtar.md5sum] = "c04a5a0a042eaa157e8e8c9eabe76bd6" |
29 | SRC_URI[libtar.sha256sum] = "0b74e51595654f958148759cfef0993114ddccccbb6f31aee018f3558e8e2732" | 26 | SRC_URI[libtar.sha256sum] = "94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871" |
30 | SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a" | 27 | SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a" |
31 | SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" | 28 | SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" |
32 | 29 | ||