[Kde-pim] [patch] proposed fix for CID:3969 (kdepimlibs/kcal/icaltimezones.cpp)

Allen Winter winter at kde.org
Thu Jan 1 11:13:48 GMT 2009


On Thursday 01 January 2009 12:45:12 am Brad Hards wrote:
> Apparently KTimezone::data() can return 0 (e.g. if !isValid()), in which
> case ICalTimeZone::update() will dereference a null pointer.
>
> Is this fix OK, or am I missing something?
>
Looks good.  Except I'm not sure if the !other.data() check should
be done before the updateBase(other) call.  David??

> Brad
>
> *** kdepimlibs/kcal/icaltimezones.cpp   (revision 902040)
> --- kdepimlibs/kcal/icaltimezones.cpp   (working copy)
> ***************
> *** 268,279 ****
> --- 268,283 ----
>   bool ICalTimeZone::update( const ICalTimeZone &other )
>   {
>     if ( !updateBase( other ) ) {
>       return false;
>     }
>
> +   if ( !other.data() ) {
> +     return false;
> +   }
> +
>     setData( other.data()->clone(), other.source() );
>     return true;
>   }
>
>   ICalTimeZone ICalTimeZone::utc()
>   {
> _______________________________________________
> 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/

_______________________________________________
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