Skip to content

Commit

Permalink
Fixes Oss-Fuzz issue: 21916 (#1180)
Browse files Browse the repository at this point in the history
* Fix heap-buffer-overflow in json_reader
  • Loading branch information
kabeer27 authored May 29, 2020
1 parent c161f4a commit 6aba23f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,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_;
}
Expand Down

0 comments on commit 6aba23f

Please sign in to comment.