[Kde-pim] Fix crash in libkolab https://bugs.kde.org/show_bug.cgi?id=305454

laurent Montel montel at kde.org
Mon Aug 20 07:29:23 BST 2012


Hi, Christian
As I can't commit in libkolab I send patch

It crashs because pointer is null and you use it :)


diff --git a/kolabformat/v2helpers.h b/kolabformat/v2helpers.h
index f93f9a1..dcc8563 100644
--- a/kolabformat/v2helpers.h
+++ b/kolabformat/v2helpers.h
@@ -77,6 +77,7 @@ QImage getPicture(const QString &pictureAttachmentName, 
const KMime::Message::Pt
     KMime::Content *imgContent = Mime::findContentByName(data, 
pictureAttachmentName/*"kolab-picture.png"*/, type);
     if (!imgContent) {
         Warning() << "could not find picture: " << pictureAttachmentName;
+        return QImage();
     }
     QByteArray imgData = imgContent->decodedContent();
     QBuffer buffer(&imgData);
@@ -268,4 +269,4 @@ QStringList readLegacyDictionaryConfiguration(const 
QByteArray &xmlData, QString
 
 }
 
-#endif
\ No newline at end of file
+#endif


Could you apply it and close bug please.
Thanks
Regards

-- 
Laurent Montel | laurent.montel at kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list