[poppler] poppler/XRef.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 9 10:33:15 UTC 2021


 poppler/XRef.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 60fb23c1d9530bb37558af38d4f616d984a42586
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Jan 9 11:24:30 2021 +0100

    XRef::readXRef: Improve overflow check
    
    oss-fuzz/11744

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 1b1af7cb..0c0c3b5f 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -463,13 +463,14 @@ bool XRef::readXRef(Goffset *pos, std::vector<Goffset> *followedXRefStm, std::ve
     Object obj;
     bool more;
 
-    if (unlikely(start > (LLONG_MAX - *pos))) {
+    Goffset parsePos;
+    if (unlikely(checkedAdd(start, *pos, &parsePos))) {
         ok = false;
         return false;
     }
 
     // start up a parser, parse one token
-    parser = new Parser(nullptr, str->makeSubStream(start + *pos, false, 0, Object(objNull)), true);
+    parser = new Parser(nullptr, str->makeSubStream(parsePos, false, 0, Object(objNull)), true);
     obj = parser->getObj(true);
 
     // parse an old-style xref table


More information about the poppler mailing list