mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-06 00:31:10 +01:00
Fixes Oss-Fuzz issue: 21916 (#1180)
* Fix heap-buffer-overflow in json_reader
This commit is contained in:
parent
c161f4ac69
commit
6aba23f4a8
@ -1270,7 +1270,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