mirror of
https://gitee.com/openharmony/third_party_jsoncpp
synced 2024-11-26 17:01:57 +00:00
!52 【master】修补out-of-bounds read
Merge pull request !52 from 冉召宇/master
This commit is contained in:
commit
b6a906ae53
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