[unique] message: Bail out of get_text_plain if len == 0
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [unique] message: Bail out of get_text_plain if len == 0
- Date: Sun, 27 Mar 2011 08:59:00 +0000 (UTC)
commit c961b2962abcf49b6cdbf841ca4ecf33c135eb1f
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Sun Mar 27 09:46:53 2011 +0100
message: Bail out of get_text_plain if len == 0
Otherwise it'll segfault in g_utf8_validate().
https://bugzilla.gnome.org/show_bug.cgi?id=634182
unique/uniquemessage.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/unique/uniquemessage.c b/unique/uniquemessage.c
index a938029..bbe7338 100644
--- a/unique/uniquemessage.c
+++ b/unique/uniquemessage.c
@@ -300,6 +300,9 @@ message_data_get_text_plain (UniqueMessageData *message_data)
gsize len;
GError *error = NULL;
+ if (message_data->length == 0)
+ return NULL;
+
str = g_strdup ((gchar *) message_data->data);
len = message_data->length;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]