aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-05-27 21:15:28 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-06-02 22:41:27 +0800
commit4a904bb36ba977e4914cc29f9d1866b15f19e341 (patch)
tree6988bef0ddcaccff74113aa70fd4d25314fa2f01 /em-format
parenta868ce4a81c64db0a6f9feb88f18479f11a900a5 (diff)
downloadgsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar.gz
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar.bz2
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar.lz
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar.xz
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.tar.zst
gsoc2013-evolution-4a904bb36ba977e4914cc29f9d1866b15f19e341.zip
Bug #540269 - Do not crash in em_format_is_attachment
Check if part contains data wrapper before accessing its members.
Diffstat (limited to 'em-format')
-rw-r--r--em-format/em-format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 8f2046c2ed..585b611e66 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1004,6 +1004,9 @@ gint em_format_is_attachment(EMFormat *emf, CamelMimePart *part)
/*CamelContentType *ct = camel_mime_part_get_content_type(part);*/
CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part);
+ if (!dw)
+ return 0;
+
/*printf("checking is attachment %s/%s\n", ct->type, ct->subtype);*/
return !(camel_content_type_is (dw->mime_type, "multipart", "*")
|| camel_content_type_is(dw->mime_type, "application", "x-pkcs7-mime")