From fbba97f9e3d95e9509b14fb1c9ca611a7a8cd765 Mon Sep 17 00:00:00 2001 From: gaochao Date: Wed, 26 Mar 2025 17:12:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?jsoncpp=E6=BC=8F=E6=B4=9Epatch=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gaochao --- 0001-Parse-large-floats-as-infinity-1349-1353.patch | 8 ++++---- ...or whenparses the value of 5E-324 with libc++.patch | 10 +++++----- install.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/0001-Parse-large-floats-as-infinity-1349-1353.patch b/0001-Parse-large-floats-as-infinity-1349-1353.patch index 791cd22..2890925 100644 --- a/0001-Parse-large-floats-as-infinity-1349-1353.patch +++ b/0001-Parse-large-floats-as-infinity-1349-1353.patch @@ -67,10 +67,10 @@ index a6a3f4e..896bf1b 100644 decoded = value; return true; } -@@ -1660,7 +1660,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { - decoded = value; - return true; - } +@@ -1647,7 +1654,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { + const String buffer(token.start_, token.end_); + IStringStream is(buffer); + if (!(is >> value)) { - return addError( + if (value == std::numeric_limits::max()) + value = std::numeric_limits::infinity(); diff --git a/Fix error whenparses the value of 5E-324 with libc++.patch b/Fix error whenparses the value of 5E-324 with libc++.patch index 2985e69..adc1116 100755 --- a/Fix error whenparses the value of 5E-324 with libc++.patch +++ b/Fix error whenparses the value of 5E-324 with libc++.patch @@ -1,8 +1,8 @@ diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp -index f233abb..8f4c544 100755 +index 896bf1b..6624cb0 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp -@@ -1666,6 +1666,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { +@@ -1654,6 +1654,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { const String buffer(token.start_, token.end_); IStringStream is(buffer); if (!(is >> value)) { @@ -12,6 +12,6 @@ index f233abb..8f4c544 100755 + decoded = value; + return true; + } - return addError( - "'" + String(token.start_, token.end_) + "' is not a number.", token); - } + if (value == std::numeric_limits::max()) + value = std::numeric_limits::infinity(); + else if (value == std::numeric_limits::lowest()) diff --git a/install.py b/install.py index d272710..7127b21 100755 --- a/install.py +++ b/install.py @@ -51,8 +51,8 @@ def apply_patch(patch_file, target_dir): def do_patch(args, target_dir): patch_file = [ - "Fix error whenparses the value of 5E-324 with libc++.patch", "0001-Parse-large-floats-as-infinity-1349-1353.patch", + "Fix error whenparses the value of 5E-324 with libc++.patch", "0001-Use-default-rather-than-hard-coded-8-for-maximum-agg.patch", "Fix out-of-bounds read.patch" ] -- Gitee From f4a8b87ef276b3e63a5bfd7c336b8f3f1f6ee259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E8=B6=85?= Date: Thu, 27 Mar 2025 03:14:12 +0000 Subject: [PATCH 2/2] update Fix error whenparses the value of 5E-324 with libc++.patch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高超 --- Fix error whenparses the value of 5E-324 with libc++.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/Fix error whenparses the value of 5E-324 with libc++.patch b/Fix error whenparses the value of 5E-324 with libc++.patch index adc1116..62e3c99 100755 --- a/Fix error whenparses the value of 5E-324 with libc++.patch +++ b/Fix error whenparses the value of 5E-324 with libc++.patch @@ -15,3 +15,4 @@ index 896bf1b..6624cb0 100644 if (value == std::numeric_limits::max()) value = std::numeric_limits::infinity(); else if (value == std::numeric_limits::lowest()) + -- Gitee