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;