diff options
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp/0001-json_writer-fix-inverted-sense-in-isAnyCharRequiredQ.patch | 52 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.2.bb | 5 |
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 @@ | |||
| 1 | From 2d5a94aeeab01f0448b5a0bb8d4a9a23a5b790d5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Childs <lorne@cons.org.nz> | ||
| 3 | Date: Sat, 28 Dec 2019 16:04:24 +0900 | ||
| 4 | Subject: [PATCH] json_writer: fix inverted sense in isAnyCharRequiredQuoting | ||
| 5 | (#1120) | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | This bug is only affects platforms where `char` is unsigned. | ||
| 11 | |||
| 12 | When char is a signed type, values >= 0x80 are also considered < 0, | ||
| 13 | and hence require escaping due to the < ' ' condition. | ||
| 14 | |||
| 15 | When char is an unsigned type, values >= 0x80 match none of the | ||
| 16 | conditions and are considered safe to emit without escaping. | ||
| 17 | |||
| 18 | This 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 | ' | ||
| 26 | Upstream-Status: Backport [https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb] | ||
| 27 | |||
| 28 | Signed-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 | |||
| 34 | diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp | ||
| 35 | index 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 | -- | ||
| 51 | 2.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" | |||
| 14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fa2a23dd1dc6c139f35105379d76df2b" | 14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fa2a23dd1dc6c139f35105379d76df2b" |
| 15 | 15 | ||
| 16 | SRCREV = "d2e6a971f4544c55b8e3b25cf96db266971b778f" | 16 | SRCREV = "d2e6a971f4544c55b8e3b25cf96db266971b778f" |
| 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https" | 17 | SRC_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 | ||
| 19 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
| 20 | 23 | ||
