diff --git a/Fix out-of-bounds read.patch b/Fix out-of-bounds read.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d979317d2dcf18a2e024d195e32afbe49ff45d1 --- /dev/null +++ b/Fix out-of-bounds read.patch @@ -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; diff --git a/install.py b/install.py index 129700fe1832707e1ca0336b628a70608667c996..31c7ad4d5ed211b58fdf8bb26a7fed31c6bdbba0 100755 --- a/install.py +++ b/install.py @@ -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: