[poppler] poppler/PDFDoc.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Wed Jan 10 22:26:31 UTC 2018
poppler/PDFDoc.cc | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit a59f61641fcb36859b625749afb4561557e419f6
Author: Albert Astals Cid <aacid at 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 <bradh at frogmouth.net>
-// Copyright (C) 2005, 2007-2009, 2011-2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2007-2009, 2011-2018 Albert Astals Cid <aacid at kde.org>
// Copyright (C) 2008 Julien Rebetez <julienr at svn.gnome.org>
// Copyright (C) 2008, 2010 Pino Toscano <pino at kde.org>
// Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <carlosgc at 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)
{
More information about the poppler
mailing list