[Uml-devel] Spurious segfault on click on note or enum widgets in class diagram

Achim Spangler A.Spangler at osb-ag.de
Wed May 17 09:59:02 UTC 2006


Hi again,
sorry - copy&paste lead to a wrong fix for the last function in this group.

Attached diff fixes this.

Bye,
Achim
Am Mittwoch, 17. Mai 2006 18:10 schrieb Achim Spangler:
> Hi,
> the current version of umbrello from REPO suffers sometimes a segfault,
> when simple items like a note or enum widget is clicked.
>
> The relevant part of the stacktrace is as follows:
> [KCrash handler]
> #6  0x08232efe in UMLWidgetController::getSmallestX ()
> #7  0x0823319d in UMLWidgetController::updateSelectionBounds ()
> #8  0x082333c0 in UMLWidgetController::mouseMoveEvent ()
> #9  0x081b6dd3 in ToolBarState::mouseMove ()
> #10 0x081b7a56 in ToolBarStateArrow::mouseMove ()
> #11 0xb7243dc7 in QScrollView::viewportMouseMoveEvent ()
>
>
> The following functions were a little unsafe:
> int UMLWidgetController::getSmallestX(const UMLWidgetList &widgetList) {
> int UMLWidgetController::getSmallestY(const UMLWidgetList &widgetList) {
> int UMLWidgetController::getBiggestX(const UMLWidgetList &widgetList) {
> int UMLWidgetController::getBiggestY(const UMLWidgetList &widgetList) {
>
> The problem was:
> When the widgetList is empty, so that the function it.toFirst() returns
> NULL, those functions dereferenced a NULL pointer without any check.
>
> I fixed this in the attached patch.
> I don't know, whether this is the only reason for the segfault. But this
> was in my opinion in any case a riscy code.
>
> Bye,
> Achim

-- 
Achim Spangler
OSB AG Ingenieur- und IT-Dienstleistungen
Klenzestraße 38
80469 München
Fon:   +49 (0) 89/23 88 57-49
Fax:   +49 (0) 89/23 88 57-40
Mobil: +49 (0)179/29 22 888
Email: a.spangler at osb-ag.de
WWW:  http://www.osb-ag.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: umlwidgetcontroller.diff
Type: text/x-diff
Size: 1680 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20060517/3735e104/attachment.bin>


More information about the umbrello-devel mailing list