[Kde-pim] parseRFCDate/parseISODate - wrong bad date handling (PATCH)

masp01 at centrum.cz masp01 at centrum.cz
Wed Jul 16 12:27:03 BST 2008


Hi,

I've found bug in kdepimlibs/syndication/tools.cpp (bugs.kde.org - 166721)

description: if string contains date in wrong format, parseRFCDate (or 
parseISODate) returns 2^32-1
 
 result: some apps (akregator) don't know about error, because returned 
value uint32_t(-1) is not the expected time_t(-1) ( = uint64_t(-1) at 
least on my computer). This leads to wrong dates being displayed
 
 Problem is located between Qt 4 and KDateTime.
 
 KDateTime::toTime_t() returns time_t (64bit at least on my computer)
 but
 QDateTime::toTime_t() returns uint (32bit)
 
 QDateTime's -1 is converted to 4294967295, but error is tested for -1
 
 solution: QDateTime's return type should be time_t, not uint
 
 fix: Don't test for -1 but do QDateTime/KDateTime::isValid() tests


patch to fix this is attached

Michal

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: parseXYZdate.patch
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080716/c12058a1/attachment.ksh>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list