[poppler] poppler/Parser.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri May 25 20:47:04 UTC 2018


 poppler/Parser.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b245154fdebc9a78db163bc95959c6c8f5b4126f
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri May 25 22:46:22 2018 +0200

    Parser::makeStream: Don't overflow length
    
    fixes oss-fuzz/8499

diff --git a/poppler/Parser.cc b/poppler/Parser.cc
index ce91e325..d1ddcaa2 100644
--- a/poppler/Parser.cc
+++ b/poppler/Parser.cc
@@ -261,7 +261,8 @@ Stream *Parser::makeStream(Object &&dict, Guchar *fileKey,
       // When building the xref we can't use it so use this
       // kludge for broken PDF files: just add 5k to the length, and
       // hope its enough
-      length += 5000;
+      if (length < LONG_LONG_MAX - 5000)
+        length += 5000;
     }
   }
 


More information about the poppler mailing list