[poppler] poppler/XRef.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Jun 8 11:36:39 PDT 2010


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

New commits:
commit 5ef45b1e72aed88ece0905b1204edee641f3c8fc
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jun 8 19:35:20 2010 +0100

    Do not exit when trying to allocate memory for the XRef fails
    
    See bug 28406

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 1e60575..9d0cd3b 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -816,7 +816,11 @@ GBool XRef::constructXRef() {
 		      return gFalse;
 		    }
 		    entries = (XRefEntry *)
-		        greallocn(entries, newSize, sizeof(XRefEntry));
+		        greallocn_checkoverflow(entries, newSize, sizeof(XRefEntry));
+		    if (entries == NULL) {
+		      size = 0;
+		      return gFalse;
+		    }
 		    for (i = size; i < newSize; ++i) {
 		      entries[i].offset = 0xffffffff;
 		      entries[i].type = xrefEntryFree;


More information about the poppler mailing list