summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch52
-rw-r--r--meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb5
2 files changed, 56 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch
new file mode 100644
index 0000000000..784f175eea
--- /dev/null
+++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch
@@ -0,0 +1,52 @@
1From 2d5a94aeeab01f0448b5a0bb8d4a9a23a5b790d5 Mon Sep 17 00:00:00 2001
2From: Andrew Childs <lorne@cons.org.nz>
3Date: Sat, 28 Dec 2019 16:04:24 +0900
4Subject: [PATCH] json_writer: fix inverted sense in isAnyCharRequiredQuoting
5 (#1120)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10This bug is only affects platforms where `char` is unsigned.
11
12When char is a signed type, values >= 0x80 are also considered < 0,
13and hence require escaping due to the < ' ' condition.
14
15When char is an unsigned type, values >= 0x80 match none of the
16conditions and are considered safe to emit without escaping.
17
18This shows up as a test failure:
19
20* Detail of EscapeSequenceTest/writeEscapeSequence test failure:
21/build/source/src/test_lib_json/main.cpp(3370): expected == result
22 Expected: '["\"","\\","\b","\f","\n","\r","\t","\u0278","\ud852\udf62"]
23 '
24 Actual : '["\"","\\","\b","\f","\n","\r","\t","ɸ","𤭢"]
25 '
26Upstream-Status: Backport [https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb]
27
28Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
29
30---
31 src/lib_json/json_writer.cpp | 5 +++--
32 1 file changed, 3 insertions(+), 2 deletions(-)
33
34diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
35index 519ce23..b68a638 100644
36--- a/src/lib_json/json_writer.cpp
37+++ b/src/lib_json/json_writer.cpp
38@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
39
40 char const* const end = s + n;
41 for (char const* cur = s; cur < end; ++cur) {
42- if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
43- static_cast<unsigned char>(*cur) < 0x80)
44+ if (*cur == '\\' || *cur == '\"' ||
45+ static_cast<unsigned char>(*cur) < ' ' ||
46+ static_cast<unsigned char>(*cur) >= 0x80)
47 return true;
48 }
49 return false;
50--
512.17.1
52
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb
index 629881f0cf..ae4b4c9840 100644
--- a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb
+++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb
@@ -14,7 +14,10 @@ LICENSE = "MIT"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=fa2a23dd1dc6c139f35105379d76df2b" 14LIC_FILES_CHKSUM = "file://LICENSE;md5=fa2a23dd1dc6c139f35105379d76df2b"
15 15
16SRCREV = "d2e6a971f4544c55b8e3b25cf96db266971b778f" 16SRCREV = "d2e6a971f4544c55b8e3b25cf96db266971b778f"
17SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https" 17SRC_URI = "\
18 git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https \
19 file://0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch \
20 "
18 21
19S = "${WORKDIR}/git" 22S = "${WORKDIR}/git"
20 23