[poppler] poppler/XRef.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 2 16:58:16 UTC 2019


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

New commits:
commit b54e1fc3e0d2600621a28d50f9f085b9e38619c2
Author: Adam Reichold <adam.reichold at t-online.de>
Date:   Fri Feb 1 08:42:27 2019 +0100

    Also defend against requests for negative XRef indices. oss-fuzz/12797

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index d042d1f4..ac2cd0ce 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -1565,6 +1565,11 @@ DummyXRefEntry dummyXRefEntry;
 
 XRefEntry *XRef::getEntry(int i, bool complainIfMissing)
 {
+  if (unlikely(i < 0)) {
+    error(errInternal, -1, "Request for invalid XRef entry [{0:d}]", i);
+    return &dummyXRefEntry;
+  }
+
   if (i >= size || entries[i].type == xrefEntryNone) {
 
     if ((!xRefStream) && mainXRefEntriesOffset) {


More information about the poppler mailing list