Commit 942a426f authored by Albert Astals Cid's avatar Albert Astals Cid

Parser::makeStream: Make sure length is not negative

fixes oss-fuzz/8469
parent bf03344a
......@@ -235,6 +235,9 @@ Stream *Parser::makeStream(Object &&dict, Guchar *fileKey,
pos = pos - 1;
lexer->lookCharLastValueCached = Lexer::LOOK_VALUE_NOT_CACHED;
}
if (unlikely(length < 0)) {
return nullptr;
}
if (unlikely(pos > LONG_LONG_MAX - length)) {
return nullptr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment