diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-15 20:20:34 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:45 +0800 |
commit | b450a294ce6978176b71425c75b9c4dba7fd2bdb (patch) | |
tree | f9a957bc467e892b63d56e67db4a9fd927b6e707 | |
parent | 6b71268cb9c32f3e50f496aa7f82ef18655ce4be (diff) | |
download | gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar.gz gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar.bz2 gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar.lz gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar.xz gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.tar.zst gsoc2013-evolution-b450a294ce6978176b71425c75b9c4dba7fd2bdb.zip |
Fix few invalid reads caused by ECanvas
-rw-r--r-- | widgets/misc/e-canvas.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 5bb51f6bfc..05832f74af 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -294,7 +294,7 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) if ((canvas->new_current_item != canvas->current_item) && (canvas->current_item != NULL) && !canvas->left_grabbed_item) { - GdkEvent new_event; + GdkEvent new_event = { 0 }; new_event = canvas->pick_event; new_event.type = GDK_LEAVE_NOTIFY; @@ -320,7 +320,7 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) canvas->current_item = canvas->new_current_item; if (canvas->current_item != NULL) { - GdkEvent new_event; + GdkEvent new_event = { 0 }; new_event = canvas->pick_event; new_event.type = GDK_ENTER_NOTIFY; @@ -511,13 +511,14 @@ canvas_key_event (GtkWidget *widget, GdkEventKey *event) { GnomeCanvas *canvas; - GdkEvent full_event; + GdkEvent full_event = { 0 }; g_return_val_if_fail (GNOME_IS_CANVAS (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); canvas = GNOME_CANVAS (widget); + full_event.type = event->type; full_event.key = *event; return canvas_emit_event (canvas, &full_event); @@ -529,7 +530,7 @@ canvas_focus_in_event (GtkWidget *widget, { GnomeCanvas *canvas; ECanvas *ecanvas; - GdkEvent full_event; + GdkEvent full_event = { 0 }; canvas = GNOME_CANVAS (widget); ecanvas = E_CANVAS (widget); @@ -543,6 +544,7 @@ canvas_focus_in_event (GtkWidget *widget, gtk_im_context_focus_in (ecanvas->im_context); if (canvas->focused_item) { + full_event.type = event->type; full_event.focus_change = *event; return canvas_emit_event (canvas, &full_event); } else { @@ -556,7 +558,7 @@ canvas_focus_out_event (GtkWidget *widget, { GnomeCanvas *canvas; ECanvas *ecanvas; - GdkEvent full_event; + GdkEvent full_event = { 0 }; canvas = GNOME_CANVAS (widget); ecanvas = E_CANVAS (widget); @@ -570,6 +572,7 @@ canvas_focus_out_event (GtkWidget *widget, gtk_im_context_focus_out (ecanvas->im_context); if (canvas->focused_item) { + full_event.type = event->type; full_event.focus_change = *event; return canvas_emit_event (canvas, &full_event); } else { @@ -634,7 +637,7 @@ e_canvas_item_grab_focus (GnomeCanvasItem *item, { GnomeCanvasItem *focused_item; GdkWindow *bin_window; - GdkEvent ev; + GdkEvent ev = { 0 }; g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); g_return_if_fail (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas))); @@ -644,6 +647,7 @@ e_canvas_item_grab_focus (GnomeCanvasItem *item, focused_item = item->canvas->focused_item; if (focused_item) { + ev.type = GDK_FOCUS_CHANGE; ev.focus_change.type = GDK_FOCUS_CHANGE; ev.focus_change.window = bin_window; ev.focus_change.send_event = FALSE; |