From 2ef66bf8cf727c6dfa8d4e20d013178d78e8492d Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Thu, 25 Aug 2022 09:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=BC=8F=E6=B4=9E=20WS-2020-?= =?UTF-8?q?0319?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- src/lib_json/json_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 8f4c544..a921dfe 100755 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -1287,7 +1287,7 @@ void OurReader::skipSpaces() { void OurReader::skipBom(bool skipBom) { // The default behavior is to skip BOM. if (skipBom) { - if (strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) { + if ((end_ - begin_) >= 3 && strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) { begin_ += 3; current_ = begin_; } -- Gitee