talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit d03db8c67b5765aff7b80b7446ebe74ffc40e782
parent 67de7a4db562991a672ea426909f58f5d528d071
Author: paul <paul@claws-mail.org>
Date:   Fri,  5 Mar 2021 06:50:32 +0000

better fix for debian bug #983778

Diffstat:
Msrc/gtk/gtkutils.c | 3++-
Msrc/prefs_customheader.c | 6+++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c @@ -1090,7 +1090,8 @@ GtkWidget *xface_get_from_header(const gchar *o_xface) static gboolean xpm_xface_init = TRUE; gchar xface[2048]; - cm_return_if_fail(sizeof(xface) < 0); + if (o_xface == NULL) + return NULL; strncpy(xface, o_xface, sizeof(xface) - 1); xface[sizeof(xface) - 1] = '\0'; diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c @@ -908,7 +908,7 @@ static gboolean prefs_custom_header_selected(GtkTreeSelection *selector, ENTRY_SET_TEXT(customhdr.hdr_entry, ch->name); ENTRY_SET_TEXT(customhdr.val_entry, ch->value); - if (!g_strcmp0("Face",ch->name)) { + if (!g_strcmp0("Face",ch->name) && ch->value != NULL) { preview = GTK_IMAGE(face_get_from_header (ch->value)); pixbuf = gtk_image_get_pixbuf(preview); gtk_image_set_from_pixbuf (GTK_IMAGE(customhdr.preview), pixbuf); @@ -916,7 +916,7 @@ static gboolean prefs_custom_header_selected(GtkTreeSelection *selector, g_object_ref_sink (G_OBJECT(preview)); } #if HAVE_LIBCOMPFACE -else if (!g_strcmp0("X-Face", ch->name)) { + else if (!g_strcmp0("X-Face", ch->name) && ch->value != NULL) { preview = GTK_IMAGE(xface_get_from_header(ch->value)); pixbuf = gtk_image_get_pixbuf(preview); gtk_image_set_from_pixbuf (GTK_IMAGE(customhdr.preview), pixbuf); @@ -924,7 +924,7 @@ else if (!g_strcmp0("X-Face", ch->name)) { g_object_ref_sink (G_OBJECT(preview)); } #endif -else { + else { gtk_widget_hide(customhdr.preview); } return TRUE;