修改漏洞 WS-2020-0319

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong 2022-08-25 09:56:37 +08:00
parent 10cdcc0343
commit 2ef66bf8cf

View File

@ -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_;
}