[Qgis-developer] dynamic_cast related to segfaults

Giuseppe Sucameli brush.tyler at gmail.com
Thu May 27 07:30:10 EDT 2010


Hi guys,
while I wrote a patch for QgsLegend, I found an issue related with
segmentation faults.

Here the bugged code:

QTreeWidgetItem* destItem = mDropTarget;
...
QgsLegendItem* dest = dynamic_cast<QgsLegendItem *>( destItem );

If mDropTarget is NULL QGis crashes with segfault.
In this case the problem is the dynamic_cast, used without make a null test
on destItem.

May some other crashes be due to a code like this??

Cheers.

-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100527/d22d826f/attachment.html


More information about the Qgis-developer mailing list