aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2010-03-24 23:51:31 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-19 20:19:53 +0800
commitcacfd2114e7dd56cc12613d625bac450cc69b4ae (patch)
tree82c9eaaa62b244bb92730a75e379240c53212aca
parent5d2de892f506cc6b870ffc02687213d3ac9e6132 (diff)
downloadgsoc2013-evolution-cacfd2114e7dd56cc12613d625bac450cc69b4ae.tar.gz
gsoc2013-evolution-cacfd2114e7dd56cc12613d625bac450cc69b4ae.tar.zst
gsoc2013-evolution-cacfd2114e7dd56cc12613d625bac450cc69b4ae.zip
Bug 612082 - Crash in em_format_snoop_type
This is not a final solution to the bug, but merely avoids a NULL pointer dereference which is likely a symptom of a deeper problem. Signed-off-by: Michel Dänzer <michel@daenzer.net>
-rw-r--r--em-format/em-format.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 19913ef5d1..a2034b4b20 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -2015,10 +2015,11 @@ em_format_snoop_type (CamelMimePart *part)
dw = camel_medium_get_content_object((CamelMedium *)part);
if (!camel_data_wrapper_is_offline(dw)) {
- CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new();
+ GByteArray *buffer = g_byte_array_new ();
+ CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new_with_byte_array(buffer);
if (camel_data_wrapper_decode_to_stream(dw, (CamelStream *)mem) > 0) {
- gchar *ct = g_content_type_guess (filename, mem->buffer->data, mem->buffer->len, NULL);
+ gchar *ct = g_content_type_guess (filename, buffer->data, buffer->len, NULL);
if (ct)
magic_type = g_content_type_get_mime_type (ct);