summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorVincent Le Garrec <legarrec.vincent@gmail.com>2019-02-02 05:00:49 +0100
committerAlbert Astals Cid <aacid@kde.org>2019-02-02 23:45:13 +0000
commit5417b8c364fb5f71176f1a22554ac98b20a58815 (patch)
treea4c6066588654b2bb6760b0df735350cd18d62d7 /fofi
parent0d4103767f99aebbf7c84165f834fd0e2b5c3054 (diff)
Integer-overflow in FoFiBase::checkRegion
oss-fuzz/8612
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiBase.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc
index 2bb116a1..03759bce 100644
--- a/fofi/FoFiBase.cc
+++ b/fofi/FoFiBase.cc
@@ -17,6 +17,7 @@
// Copyright (C) 2011 Jim Meyering <jim@meyering.net>
// Copyright (C) 2016, 2018 Albert Astals Cid <aacid@kde.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
// 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 {
bool FoFiBase::checkRegion(int pos, int size) const {
return pos >= 0 &&
+ size >= 0 &&
pos < INT_MAX - size &&
size < INT_MAX - pos &&
pos + size >= pos &&