[gtk+] dnd: Avoid a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] dnd: Avoid a crash
- Date: Sun, 21 Feb 2016 03:45:00 +0000 (UTC)
commit e9300e2f7917dd67c8adc8c08390c44ca22f0d9b
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 20 22:43:43 2016 -0500
dnd: Avoid a crash
gtk_image_definition_new_icon_name ("") returns NULL. Bail
out early in this case to avoid unreffing NULL later.
https://bugzilla.gnome.org/show_bug.cgi?id=762392
gtk/gtkdnd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index e00aab2..48be48c 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -2857,7 +2857,7 @@ gtk_drag_set_icon_name (GdkDragContext *context,
GtkImageDefinition *def;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (icon_name != NULL);
+ g_return_if_fail (icon_name != NULL && icon_name[0] != '\0');
def = gtk_image_definition_new_icon_name (icon_name);
set_icon_helper (context, def, hot_x, hot_y);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]