Skip to content
Snippets Groups Projects
Unverified Commit 6aba23f4 authored by kabeer27's avatar kabeer27 Committed by GitHub
Browse files

Fixes Oss-Fuzz issue: 21916 (#1180)

* Fix heap-buffer-overflow in json_reader
parent c161f4ac
No related branches found
No related tags found
No related merge requests found
......@@ -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_;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment