!52 【master】修补out-of-bounds read

Merge pull request !52 from 冉召宇/master
This commit is contained in:
openharmony_ci 2024-09-20 09:17:02 +00:00 committed by Gitee
commit b6a906ae53
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 23 additions and 1 deletions

View 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;

View File

@ -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: