From cfe00e57095831ccd8a290d2d7f7bbe6624c3d55 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 4 Jan 2006 12:38:06 +0000 Subject: [PATCH] guard against multiplying by -1 (when n_args is 0). 2006-01-04 Rodrigo Moya * gtk/gtkbindings.c (binding_signal_new): guard against multiplying by -1 (when n_args is 0). --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gtk/gtkbindings.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 91dcf4dc40..b0f05464cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-01-04 Rodrigo Moya + + * gtk/gtkbindings.c (binding_signal_new): guard against multiplying + by -1 (when n_args is 0). + 2006-01-04 Michael Natterer * gtk/gtkmenutoolbutton.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 91dcf4dc40..b0f05464cc 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2006-01-04 Rodrigo Moya + + * gtk/gtkbindings.c (binding_signal_new): guard against multiplying + by -1 (when n_args is 0). + 2006-01-04 Michael Natterer * gtk/gtkmenutoolbutton.c diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c index a6afdc8e90..2bffa387da 100644 --- a/gtk/gtkbindings.c +++ b/gtk/gtkbindings.c @@ -65,7 +65,7 @@ binding_signal_new (const gchar *signal_name, { GtkBindingSignal *signal; - signal = (GtkBindingSignal *) g_malloc0 (sizeof (GtkBindingSignal) + (n_args - 1) * sizeof (GtkBindingArg)); + signal = (GtkBindingSignal *) g_malloc0 (sizeof (GtkBindingSignal) + (n_args > 0 ? n_args - 1 : 0) * sizeof (GtkBindingArg)); signal->next = NULL; signal->signal_name = (gchar *)g_intern_string (signal_name); signal->n_args = n_args;