[poppler] qt4/src

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Feb 4 14:36:27 PST 2008


 qt4/src/poppler-document.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6d58cda82b0181f2cca6e9d95b15877793be0812
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Feb 4 23:33:51 2008 +0100

    Protect us against weird dateString values

diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index fd9473c..c328454 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -488,9 +488,12 @@ namespace Poppler {
         int tzHours = 0;
         int tzMins = 0;
 
+        if ( dateString == NULL ) return QDateTime();
+        if ( strlen(dateString) < 2 ) return QDateTime();
+
         if ( dateString[0] == 'D' && dateString[1] == ':' )
             dateString += 2;
-        if ( sscanf( dateString,
+        if ( dateString != NULL && sscanf( dateString,
 		     "%4d%2d%2d%2d%2d%2d%c%2d%*c%2d",
 		     &year, &mon, &day, &hour, &min, &sec,
 		     &tz, &tzHours, &tzMins ) > 0 ) {


More information about the poppler mailing list