mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibPDF: Parser::parse_header() return false if remaining bytes is zero
This commit is contained in:
parent
92fdae178b
commit
6ccfa3e75e
Notes:
sideshowbarker
2024-07-18 01:44:43 +09:00
Author: https://github.com/bcoles
Commit: 6ccfa3e75e
Pull-request: https://github.com/SerenityOS/serenity/pull/10704
Issue: https://github.com/SerenityOS/serenity/issues/10702
1 changed files with 2 additions and 0 deletions
|
@ -91,6 +91,8 @@ bool Parser::parse_header()
|
|||
{
|
||||
// FIXME: Do something with the version?
|
||||
m_reader.set_reading_forwards();
|
||||
if (m_reader.remaining() == 0)
|
||||
return false;
|
||||
m_reader.move_to(0);
|
||||
if (m_reader.remaining() < 8 || !m_reader.matches("%PDF-"))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue