mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibGfx: Don't read past EOF in JPEGLoader
Previously, it was possible to pass JPEGLoader a crafted input which would read past the end of the stream. We now return an error in such cases.
This commit is contained in:
parent
001abbcd66
commit
dd81bea9ef
Notes:
sideshowbarker
2024-07-17 01:13:25 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/dd81bea9ef Pull-request: https://github.com/SerenityOS/serenity/pull/21293 Reviewed-by: https://github.com/gmta ✅
@ -230,6 +230,9 @@ private:
|
||||
VERIFY(m_byte_offset == m_current_size);
|
||||
|
||||
m_current_size = TRY(m_stream->read_some(m_buffer.span())).size();
|
||||
if (m_current_size == 0)
|
||||
return Error::from_string_literal("Unexpected end of file");
|
||||
|
||||
m_byte_offset = 0;
|
||||
|
||||
return {};
|
||||
|
Loading…
Reference in New Issue
Block a user