commit 2cd46df8f5b924f9969b28aaa36ec73b616a1961
parent ad31bc5b69a542274bcf1e23726442caf8ee84b0
Author: paul <paul@claws-mail.org>
Date: Fri, 5 Mar 2021 06:50:32 +0000
better fix for debian bug #983778
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
@@ -1113,7 +1113,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
@@ -898,7 +898,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);
@@ -906,7 +906,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);
@@ -914,7 +914,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;