[poppler] poppler/Parser.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Jul 18 18:32:00 UTC 2018


 poppler/Parser.cc |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 004e3c10df0abda214f0c293f9e269fdd979c5ee
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Jul 18 20:31:27 2018 +0200

    Fix crash when Object has negative number
    
    Spec says object number has to be > 0 and gen has to be >= 0
    
    Reported by email

diff --git a/poppler/Parser.cc b/poppler/Parser.cc
index 39c9a967..8b0093e3 100644
--- a/poppler/Parser.cc
+++ b/poppler/Parser.cc
@@ -154,6 +154,11 @@ Object Parser::getObj(GBool simpleOnly,
       const int gen = buf1.getInt();
       shift();
       shift();
+
+      if (unlikely(num <= 0 || gen < 0)) {
+          return Object();
+      }
+
       return Object(num, gen);
     } else {
       return Object(num);


More information about the poppler mailing list