Commit 5417b8c3 authored by Vincent Le Garrec's avatar Vincent Le Garrec Committed by Albert Astals Cid
Browse files

Integer-overflow in FoFiBase::checkRegion

oss-fuzz/8612
parent 0d410376
Pipeline #17417 passed with stage
in 6 minutes and 12 seconds
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
// Copyright (C) 2011 Jim Meyering <jim@meyering.net> // Copyright (C) 2011 Jim Meyering <jim@meyering.net>
// Copyright (C) 2016, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2016, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2019 Christian Persch <chpe@src.gnome.org> // Copyright (C) 2019 Christian Persch <chpe@src.gnome.org>
// Copyright (C) 2019 LE GARREC Vincent <legarrec.vincent@gmail.com>
// //
// To see a description of the changes please see the Changelog file that // To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git // came with your tarball or type make ChangeLog if you are building from git
...@@ -195,6 +196,7 @@ unsigned int FoFiBase::getUVarBE(int pos, int size, bool *ok) const { ...@@ -195,6 +196,7 @@ unsigned int FoFiBase::getUVarBE(int pos, int size, bool *ok) const {
bool FoFiBase::checkRegion(int pos, int size) const { bool FoFiBase::checkRegion(int pos, int size) const {
return pos >= 0 && return pos >= 0 &&
size >= 0 &&
pos < INT_MAX - size && pos < INT_MAX - size &&
size < INT_MAX - pos && size < INT_MAX - pos &&
pos + size >= pos && pos + size >= pos &&
......
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