LibGfx: Fix bounds overflow in JPGLoader
Taotao Gu has been fuzzing serenity libs with their own custom fuzzer. They reported some issues it found privately, this overflow was found in the JPGLoader using that fuzzer. Reported-by: Taotao Gu <gutaotao1995@qq.com>
This commit is contained in:
parent
4ea910d129
commit
9191829a39
Notes:
sideshowbarker
2024-07-17 11:46:09 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/9191829a39 Pull-request: https://github.com/SerenityOS/serenity/pull/13714
1 changed files with 2 additions and 0 deletions
|
@ -420,6 +420,8 @@ static Optional<Vector<Macroblock>> decode_huffman_stream(JPGLoadingContext& con
|
|||
|
||||
static inline bool bounds_okay(const size_t cursor, const size_t delta, const size_t bound)
|
||||
{
|
||||
if (Checked<size_t>::addition_would_overflow(delta, cursor))
|
||||
return false;
|
||||
return (delta + cursor) < bound;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue