Fixes Oss-Fuzz issue: 21916 (#1180)
* Fix heap-buffer-overflow in json_reader
This commit is contained in:
parent
1d38f0d6b4
commit
3228be44b0
@ -1287,7 +1287,7 @@ void OurReader::skipSpaces() {
|
|||||||
void OurReader::skipBom(bool skipBom) {
|
void OurReader::skipBom(bool skipBom) {
|
||||||
// The default behavior is to skip BOM.
|
// The default behavior is to skip BOM.
|
||||||
if (skipBom) {
|
if (skipBom) {
|
||||||
if (strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) {
|
if ((end_ - begin_) >= 3 && strncmp(begin_, "\xEF\xBB\xBF", 3) == 0) {
|
||||||
begin_ += 3;
|
begin_ += 3;
|
||||||
current_ = begin_;
|
current_ = begin_;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user