GNOME Bugzilla – Bug 350539
check for NULL in camel_mime_part_get_content_type()
Last modified: 2007-08-16 10:57:18 UTC
Distribution: Fedora Core release 5 (Bordeaux) Package: bug-buddy Severity: Normal Version: GNOME2.14.0 2.14.x Gnome-Distributor: Red Hat, Inc Synopsis: Drag-n-drop PDF file attachement Bugzilla-Product: bug-buddy Bugzilla-Component: general Bugzilla-Version: 2.14.x BugBuddy-GnomeVersion: 2.0 (2.14.0) Description: Description of the crash: Steps to reproduce the crash: 1. New email message 2. Drag and drop PDF file from smb://server/directory resource 3. Crash evolution! Expected Results: doesn't crash. How often does this happen? Additional Information: Debugging Information: Backtrace was generated from '/usr/bin/evolution-2.6' (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (no debugging symbols found) `shared object read from target memory' has disappeared; keeping its symbols. (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1208342864 (LWP 3037)] [New Thread -1528165472 (LWP 3069)] [New Thread -1471239264 (LWP 3052)] [New Thread -1460749408 (LWP 3051)] [New Thread -1391666272 (LWP 3049)] [New Thread -1380979808 (LWP 3048)] [New Thread -1370489952 (LWP 3047)] [New Thread -1298932832 (LWP 3045)] [New Thread -1288442976 (LWP 3042)] [New Thread -1277559904 (LWP 3041)] [New Thread -1267065952 (LWP 3039)] (no debugging symbols found) 0x009a9402 in __kernel_vsyscall ()
+ Trace 70115
Thread 1 (Thread -1208342864 (LWP 3037))
------- Bug created by bug-buddy at 2006-08-09 07:52 ------- Bugreport moved from bug-buddy / general to Evolution / Miscellaneous Unknown version 2.14.x in product Evolution. Setting version to "unspecified".
Reassign to the right component.
could be a duplicate of bug 327678
ceo: are you still able to reproduce this?
we should check if the mime_part is null in the function camel_mime_part_get_content_type as shown below: CamelContentType * camel_mime_part_get_content_type (CamelMimePart *mime_part) { g_return_val_if_fail (CAMEL_IS_MIME_PART (mime_part), NULL); return ((CamelDataWrapper *) mime_part)->mime_type; } The smb share file might not have been actually downloaded, the mime_part would be NULL in such a case.
I feel that the check for NULL should be done at a level above camel_mime_part_get_content_type()
(In reply to comment #5) > I feel that the check for NULL should be done at a level above > camel_mime_part_get_content_type() > Agreed. That would be the absolutely right way to do it.
Thanks for taking the time to report this bug. Unfortunately, that stack trace is missing some elements that will help a lot to solve the problem, so it will be hard for the developers to fix that crash. Can you get us a stack trace with debugging symbols? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Created attachment 93347 [details] [review] proposed evo patch for evolution; I'm not sure with this much, it's a little bit paranoic here :)
Created attachment 93348 [details] [review] proposed eds patch for evolution-data-server; All other places where is camel_mime_part_get_content_type used seems to me safe.
Fejj, do you really want this way? Too many changes, I see. Unless there is a real reason/value for this. PS: Some how, I always like g_free instead of free, because it checks for NULL and makes my code clean and more readable.
If it is really required this way, lets commit. Milan, you gotto announce a few strings that you have introduced into this.
eds part committed to trunk. Committed revision 7962. evo part committed to trunk. Committed revision 34017. Announce string change mail sent too, I'm sorry for that, I didn't know.