Skip to content

Commit 90cc4b9

Browse files
committed
Fix heap-buffer-overflow in json_reader
1 parent 0647d1f commit 90cc4b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/lib_json/json_reader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ void OurReader::skipSpaces() {
12701270
void OurReader::skipBom(bool skipBom) {
12711271
// The default behavior is to skip BOM.
12721272
if (skipBom) {
1273-
if (strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) {
1273+
if ((end_ - begin_) >= 3 && strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) {
12741274
begin_ += 3;
12751275
current_ = begin_;
12761276
}

0 commit comments

Comments
 (0)