[poppler] Branch 'poppler-0.20' - poppler/Linearization.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jun 10 13:38:38 PDT 2012


 poppler/Linearization.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e3fe88df3646a80945210ba426eb4681a98b55e9
Author: Hib Eris <hib at hiberis.nl>
Date:   Sun Jun 10 19:44:18 2012 +0200

    Check value of first page in linearization table
    
    Fixes crash in broken/fuzzed pdf sent by Mateusz "j00ru" Jurczyk and Gynvael Coldwind

diff --git a/poppler/Linearization.cc b/poppler/Linearization.cc
index 7b8f1e0..33331d1 100644
--- a/poppler/Linearization.cc
+++ b/poppler/Linearization.cc
@@ -4,7 +4,7 @@
 //
 // This file is licensed under the GPLv2 or later
 //
-// Copyright 2010 Hib Eris <hib at hiberis.nl>
+// Copyright 2010, 2012 Hib Eris <hib at hiberis.nl>
 //
 //========================================================================
 
@@ -211,7 +211,7 @@ int Linearization::getPageFirst()
     linDict.getDict()->lookupInt("P", NULL, &pageFirst);
   }
 
-  if (pageFirst < 0) {
+  if ((pageFirst < 0) || (pageFirst > getNumPages())) {
     error(errSyntaxWarning, -1, "First page in linearization table is invalid");
     return 0;
   }


More information about the poppler mailing list