[poppler] poppler/Hints.cc poppler/XRef.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 10:59:36 UTC 2019


 poppler/Hints.cc |   10 ++++++----
 poppler/XRef.cc  |    4 +++-
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 97bbfd67d7fa4d633e10e3dc90fd523051607836
Author: LE GARREC Vincent <gitlab-freedesktop at le-garrec.fr>
Date:   Wed Apr 17 10:59:34 2019 +0000

    ofz-11248: Use-of-uninitialized-value in Parser::makeStream

diff --git a/poppler/Hints.cc b/poppler/Hints.cc
index aeb7542c..05d2f74d 100644
--- a/poppler/Hints.cc
+++ b/poppler/Hints.cc
@@ -138,10 +138,12 @@ Hints::Hints(BaseStream *str, Linearization *linearization, XRef *xref, Security
     nPages = 0;
   }
 
-  memset(pageLength, 0, nPages * sizeof(unsigned int));
-  memset(pageOffset, 0, nPages * sizeof(unsigned int));
-  memset(numSharedObject, 0, nPages * sizeof(unsigned int));
-  memset(pageObjectNum, 0, nPages * sizeof(int));
+  if (nPages != 0) {
+    memset(pageLength, 0, nPages * sizeof(unsigned int));
+    memset(pageOffset, 0, nPages * sizeof(unsigned int));
+    memset(numSharedObject, 0, nPages * sizeof(unsigned int));
+    memset(pageObjectNum, 0, nPages * sizeof(int));
+  }
 
   groupLength = nullptr;
   groupOffset = nullptr;
diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 68f92d05..87a08c7d 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -27,6 +27,7 @@
 // Copyright (C) 2016 Jakub Alba <jakubalba at gmail.com>
 // Copyright (C) 2018, 2019 Adam Reichold <adam.reichold at t-online.de>
 // Copyright (C) 2018 Tobias Deiminger <haxtibal at posteo.de>
+// Copyright (C) 2019 LE GARREC Vincent <legarrec.vincent at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1576,7 +1577,8 @@ XRefEntry *XRef::getEntry(int i, bool complainIfMissing)
       }
 
       if (!parseEntry(mainXRefEntriesOffset + 20*i, &entries[i])) {
-        error(errSyntaxError, -1, "Failed to parse XRef entry [{0:d}].", i);
+	error(errSyntaxError, -1, "Failed to parse XRef entry [{0:d}].", i);
+	return &dummyXRefEntry;
       }
     } else {
       // Read XRef tables until the entry we're looking for is found


More information about the poppler mailing list