mirror of
https://gitee.com/openharmony/third_party_jsoncpp
synced 2024-11-23 07:20:16 +00:00
!54 【5.0】fix out-of-bounds read
Merge pull request !54 from 冉召宇/OpenHarmony-5.0.0-Release
This commit is contained in:
commit
53d23cc287
21
Fix out-of-bounds read.patch
Normal file
21
Fix out-of-bounds read.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp
|
||||
--- a/src/lib_json/json_reader.cpp
|
||||
+++ b/src/lib_json/json_reader.cpp
|
||||
@@ -773,7 +773,7 @@
|
||||
while (current < location && current != end_) {
|
||||
Char c = *current++;
|
||||
if (c == '\r') {
|
||||
- if (*current == '\n')
|
||||
+ if (current != end_ && *current == '\n')
|
||||
++current;
|
||||
lastLineStart = current;
|
||||
++line;
|
||||
@@ -1826,7 +1826,7 @@
|
||||
while (current < location && current != end_) {
|
||||
Char c = *current++;
|
||||
if (c == '\r') {
|
||||
- if (*current == '\n')
|
||||
+ if (current != end_ && *current == '\n')
|
||||
++current;
|
||||
lastLineStart = current;
|
||||
++line;
|
@ -50,7 +50,8 @@ 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",
|
||||
"0001-Use-default-rather-than-hard-coded-8-for-maximum-agg.patch"
|
||||
"0001-Use-default-rather-than-hard-coded-8-for-maximum-agg.patch",
|
||||
"Fix out-of-bounds read.patch"
|
||||
]
|
||||
|
||||
for patch in patch_file:
|
||||
|
Loading…
Reference in New Issue
Block a user