poppler/PDFDoc.cc |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a59f61641fcb36859b625749afb4561557e419f6
Author: Albert Astals Cid <aa...@kde.org>
Date:   Wed Jan 10 23:24:19 2018 +0100

    PDFDoc::setup: Fail early if base stream length is 0
    
    Bug #103552

diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 8fca2020..8aefc0b1 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -14,7 +14,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2005, 2006, 2008 Brad Hards <br...@frogmouth.net>
-// Copyright (C) 2005, 2007-2009, 2011-2017 Albert Astals Cid <aa...@kde.org>
+// Copyright (C) 2005, 2007-2009, 2011-2018 Albert Astals Cid <aa...@kde.org>
 // Copyright (C) 2008 Julien Rebetez <juli...@svn.gnome.org>
 // Copyright (C) 2008, 2010 Pino Toscano <p...@kde.org>
 // Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <carlo...@gnome.org>
@@ -251,6 +251,13 @@ PDFDoc::PDFDoc(BaseStream *strA, GooString *ownerPassword,
 
 GBool PDFDoc::setup(GooString *ownerPassword, GooString *userPassword) {
   pdfdocLocker();
+
+  if (str->getLength() <= 0)
+  {
+    error(errSyntaxError, -1, "Document stream is empty");
+    return gFalse;
+  }
+
   str->setPos(0, -1);
   if (str->getPos() < 0)
   {
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to