From 0cad69fcdda49e5c950e220696aa5b45a0b702c5 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 29 Jan 2004 16:33:30 +0000 Subject: [PATCH] nul-terminate the target atoms. (#132656, Christian Persch) Thu Jan 29 11:00:18 2004 Owen Taylor * gtk/gtkselection.c (gtk_selection_default_handler): nul-terminate the target atoms. (#132656, Christian Persch) --- ChangeLog | 18 ++++++++++++------ ChangeLog.pre-2-10 | 18 ++++++++++++------ ChangeLog.pre-2-4 | 18 ++++++++++++------ ChangeLog.pre-2-6 | 18 ++++++++++++------ ChangeLog.pre-2-8 | 18 ++++++++++++------ gtk/gtkselection.c | 7 +++++-- 6 files changed, 65 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index de3252592c..d0dbac1f78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,20 @@ +Thu Jan 29 11:00:18 2004 Owen Taylor + + * gtk/gtkselection.c (gtk_selection_default_handler): + nul-terminate the target atoms. (#132656, Christian Persch) + Thu Jan 29 00:59:03 2004 Matthias Clasen - * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): Don't leak - path if we bail out early. (#132505, Christian Persch) + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): + Don't leak path if we bail out early. (#132505, Christian Persch) Thu Jan 29 00:48:47 2004 Matthias Clasen - * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): - * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do reference - counting on the user_data that is shared between multiple signal handlers, - to avoid calling the destroy notify multiple times. (#132447, Adam Hooper) + * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): + * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do + reference counting on the user_data that is shared between + multiple signal handlers, to avoid calling the destroy notify + multiple times. (#132447, Adam Hooper) 2004-01-28 Hans Breuer diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index de3252592c..d0dbac1f78 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,14 +1,20 @@ +Thu Jan 29 11:00:18 2004 Owen Taylor + + * gtk/gtkselection.c (gtk_selection_default_handler): + nul-terminate the target atoms. (#132656, Christian Persch) + Thu Jan 29 00:59:03 2004 Matthias Clasen - * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): Don't leak - path if we bail out early. (#132505, Christian Persch) + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): + Don't leak path if we bail out early. (#132505, Christian Persch) Thu Jan 29 00:48:47 2004 Matthias Clasen - * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): - * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do reference - counting on the user_data that is shared between multiple signal handlers, - to avoid calling the destroy notify multiple times. (#132447, Adam Hooper) + * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): + * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do + reference counting on the user_data that is shared between + multiple signal handlers, to avoid calling the destroy notify + multiple times. (#132447, Adam Hooper) 2004-01-28 Hans Breuer diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index de3252592c..d0dbac1f78 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,14 +1,20 @@ +Thu Jan 29 11:00:18 2004 Owen Taylor + + * gtk/gtkselection.c (gtk_selection_default_handler): + nul-terminate the target atoms. (#132656, Christian Persch) + Thu Jan 29 00:59:03 2004 Matthias Clasen - * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): Don't leak - path if we bail out early. (#132505, Christian Persch) + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): + Don't leak path if we bail out early. (#132505, Christian Persch) Thu Jan 29 00:48:47 2004 Matthias Clasen - * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): - * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do reference - counting on the user_data that is shared between multiple signal handlers, - to avoid calling the destroy notify multiple times. (#132447, Adam Hooper) + * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): + * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do + reference counting on the user_data that is shared between + multiple signal handlers, to avoid calling the destroy notify + multiple times. (#132447, Adam Hooper) 2004-01-28 Hans Breuer diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index de3252592c..d0dbac1f78 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,14 +1,20 @@ +Thu Jan 29 11:00:18 2004 Owen Taylor + + * gtk/gtkselection.c (gtk_selection_default_handler): + nul-terminate the target atoms. (#132656, Christian Persch) + Thu Jan 29 00:59:03 2004 Matthias Clasen - * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): Don't leak - path if we bail out early. (#132505, Christian Persch) + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): + Don't leak path if we bail out early. (#132505, Christian Persch) Thu Jan 29 00:48:47 2004 Matthias Clasen - * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): - * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do reference - counting on the user_data that is shared between multiple signal handlers, - to avoid calling the destroy notify multiple times. (#132447, Adam Hooper) + * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): + * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do + reference counting on the user_data that is shared between + multiple signal handlers, to avoid calling the destroy notify + multiple times. (#132447, Adam Hooper) 2004-01-28 Hans Breuer diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index de3252592c..d0dbac1f78 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,14 +1,20 @@ +Thu Jan 29 11:00:18 2004 Owen Taylor + + * gtk/gtkselection.c (gtk_selection_default_handler): + nul-terminate the target atoms. (#132656, Christian Persch) + Thu Jan 29 00:59:03 2004 Matthias Clasen - * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): Don't leak - path if we bail out early. (#132505, Christian Persch) + * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_rows_reordered): + Don't leak path if we bail out early. (#132505, Christian Persch) Thu Jan 29 00:48:47 2004 Matthias Clasen - * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): - * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do reference - counting on the user_data that is shared between multiple signal handlers, - to avoid calling the destroy notify multiple times. (#132447, Adam Hooper) + * gtk/gtkactiongroup.c (gtk_action_group_add_toggle_actions_full): + * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full): Do + reference counting on the user_data that is shared between + multiple signal handlers, to avoid calling the destroy notify + multiple times. (#132447, Adam Hooper) 2004-01-28 Hans Breuer diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 6d976896ea..e14135e253 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1884,9 +1884,12 @@ gtk_selection_default_handler (GtkWidget *widget, data->type = GDK_SELECTION_TYPE_ATOM; data->format = 32; data->length = count * sizeof (GdkAtom); - - p = g_new (GdkAtom, count); + + /* selection data is always terminated by a trailing \0 + */ + p = g_malloc (data->length + 1); data->data = (guchar *)p; + data->data[data->length] = '\0'; *p++ = gtk_selection_atoms[TIMESTAMP]; *p++ = gtk_selection_atoms[TARGETS];