diff options
author | Timm Bäder <mail@baedert.org> | 2018-01-18 14:43:36 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-01-18 14:45:13 +0100 |
commit | aee4634ee52220291a898318a7b3e22ec3fcbed2 (patch) | |
tree | 08a39260f80785d5a2b87e9d0e28f090d07a2e1a /gtk | |
parent | cc9a4c17207e7bab3c09d608dc65ea8d445bc7e5 (diff) | |
download | gtk+-aee4634ee52220291a898318a7b3e22ec3fcbed2.tar.gz |
widget: Always assign values to out parameter in translate_coordinates
safe guard against people using the returned coordinate values without
checking the return value of gtk_widget_translate_coordinates.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkwidget.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 46ad98022d..55c4d60fda 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -4888,7 +4888,13 @@ gtk_widget_translate_coordinates (GtkWidget *src_widget, ancestor = gtk_widget_common_ancestor (src_widget, dest_widget); if (!ancestor || !_gtk_widget_get_realized (src_widget) || !_gtk_widget_get_realized (dest_widget)) - return FALSE; + { + if (dest_x) + *dest_x = 0; + if (dest_y) + *dest_y = 0; + return FALSE; + } parent = src_widget; |