[poppler] Branch 'poppler-0.6' - qt4/src

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


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

New commits:
commit 8f954fe9799e6c20a0cafdf5bb174d5c77609161
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 d229d47..92b062d 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -499,9 +499,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