mirror of
https://github.com/openharmony/third_party_jsoncpp.git
synced 2026-07-16 08:54:25 -04:00
@@ -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<double>::max())
|
||||
+ value = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -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,7 @@ 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<double>::max())
|
||||
value = std::numeric_limits<double>::infinity();
|
||||
else if (value == std::numeric_limits<double>::lowest())
|
||||
|
||||
|
||||
+1
-1
@@ -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"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user