Review Request: Crash guards in KCMultiDialog

View: New views
2 Messages — Rating Filter:   Alert me  

Review Request: Crash guards in KCMultiDialog

by Stephen Kelly-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2114/
-----------------------------------------------------------

Review request for kdelibs.


Summary
-------

Currently in trunk you get a crash when clicking configure in KJots.

The reason is that KJotsConfigDlg (which is-a KCMultiDialog) uses setButtons( Default | Ok | Cancel ); and so in KCMultiDialogPrivate, q->button(KDialog::Apply) is 0 and crashes on setAuthAction.

This patch adds crash guards.

However, The existing code looks a bit funny. In the else branch, setAuthAction is used even though it has been determined that currentModule->realModule()->needsAuthorization() is false. Is that right?


Diffs
-----

  trunk/KDE/kdelibs/kutils/kcmultidialog.cpp 1028931

Diff: http://reviewboard.kde.org/r/2114/diff


Testing
-------

Fixes crash for me.


Thanks,

Stephen


Re: Review Request: Crash guards in KCMultiDialog

by Aaron J. Seigo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2114/#review3012
-----------------------------------------------------------

Ship it!


crash fix looks good; as for the auth action, i believe that it is needed to be set in any case to catch changes in authorization or to clear the auth action if one was previously set. i could be wrong, though, this is just from memories of looking at this stuff at Tokamak III a few months back ...

- Aaron


On 2009-11-10 10:08:37, Stephen Kelly wrote:

>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2114/
> -----------------------------------------------------------
>
> (Updated 2009-11-10 10:08:37)
>
>
> Review request for kdelibs.
>
>
> Summary
> -------
>
> Currently in trunk you get a crash when clicking configure in KJots.
>
> The reason is that KJotsConfigDlg (which is-a KCMultiDialog) uses setButtons( Default | Ok | Cancel ); and so in KCMultiDialogPrivate, q->button(KDialog::Apply) is 0 and crashes on setAuthAction.
>
> This patch adds crash guards.
>
> However, The existing code looks a bit funny. In the else branch, setAuthAction is used even though it has been determined that currentModule->realModule()->needsAuthorization() is false. Is that right?
>
>
> Diffs
> -----
>
>   trunk/KDE/kdelibs/kutils/kcmultidialog.cpp 1028931
>
> Diff: http://reviewboard.kde.org/r/2114/diff
>
>
> Testing
> -------
>
> Fixes crash for me.
>
>
> Thanks,
>
> Stephen
>
>