Suspicious code in kdegraphics-3.5.2

Clarence Dang dang at kde.org
Sat Apr 22 12:16:25 BST 2006


On Saturday 22 April 2006 09:36, Christoph Bartoschek wrote:
> - kolourpaint/kpview.cpp:1608
> - kolourpaint/kpview.cpp:1616
> - kolourpaint/kpview.cpp:1638
>
> 0 && ?

Code which didn't give the right effects.  Left in so that I can play with it 
later.

>
> - kolourpaint/tools/kptoolpen.cpp:260
>
> If line 245 is false then renderMode is uninitialized here.

"Will never happen".  Code will be refined in trunk/ to make this clearer.

> - kolourpaint/tools/kptoolselection.cpp:1095
> - kolourpaint/tools/kptoolselection.cpp:1217
>
> && true ?

Left in for debugging - easy to change to "&& false".

> ------------------------------------
> Problems involving the NULL pointer:
> ------------------------------------
>
> - kolourpaint/tools/kptoolresizescale.cpp:219
>
> If line 213 is true, line 219 crashes.

"Will never happen".  But fixed locally anyway.

> - kolourpaint/tools/kptoolselection.cpp:1871
> - kolourpaint/tools/kptoolselection.cpp:1915 (similar)
> - kolourpaint/kpdocument.cpp:1012 (similar)
>
> If m_mainWindow is NULL as indicated by line 1854, then line 1870
> crashes.
>
> - kolourpaint/tools/kptoolselection.cpp:1646
>
> If m_mainWindow is NULL as indicated by line 1637, then line 1646
> crashes.

"Will never happen".  I am tempted simply to remove the "m_mainWindow" checks 
entirely as "m_mainWindow" can never be NULL.




More information about the kde-core-devel mailing list