[evolution/gnome-2-30] Bug 612082 - Crash in em_format_snoop_type
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-2-30] Bug 612082 - Crash in em_format_snoop_type
- Date: Wed, 19 May 2010 12:22:29 +0000 (UTC)
commit cacfd2114e7dd56cc12613d625bac450cc69b4ae
Author: Michel Dänzer <michel daenzer net>
Date: Wed Mar 24 16:51:31 2010 +0100
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>
em-format/em-format.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 19913ef..a2034b4 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]