Bug 213460

Summary: KMail crash when reply-all hit on SOME emails. (null dereference)
Product: [Applications] kmail Reporter: Daniel Kulp <dan>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Daniel Kulp 2009-11-06 19:59:58 UTC
Version:            (using KDE 4.3.3)
Compiler:          gcc version 4.3.4 
OS:                Linux
Installed from:    Gentoo Packages


In objecttreeparser.cpp at line 1314, the current code looks like:

      if ( !dataHtml && mReader->htmlMail() ) {

However, in SOME cases, when I hit reply-all, the mReader field is null.   If I change the code to:
if ( !dataHtml && mReader && mReader->htmlMail() ) {

to make sure the null is not dereferenced, then everything seems to work fine for me.  I'm NOT sure why mReader is null, but there ARE checks later in the same method for mReader being null so I assume that it's allowed.
Comment 1 Allen Winter 2009-11-07 15:49:27 UTC
SVN commit 1046105 by winterz:

add a crash guard for mReader when reply-all on html emails
thanks for the patch Daniel.
BUG: 213460
MERGE: 4.3,e4


 M  +1 -1      objecttreeparser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046105
Comment 2 Allen Winter 2009-11-07 15:50:30 UTC
SVN commit 1046106 by winterz:

Backport r1046105 by winterz from trunk to the 4.3 branch:

add a crash guard for mReader when reply-all on html emails
thanks for the patch Daniel.
CCBUG: 213460
MERGE: 4.3,e4



 M  +1 -1      objecttreeparser.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046106
Comment 3 Thomas McGuire 2009-11-11 16:10:12 UTC
Thanks Daniel for the patch, that was the correct way to fix it.

My fault, I forgot again that the objecttreeparser can be used without having a reader widget.