guard against multiplying by -1 (when n_args is 0).

2006-01-04  Rodrigo Moya <rodrigo@novell.com>

	* gtk/gtkbindings.c (binding_signal_new): guard against multiplying
	by -1 (when n_args is 0).
This commit is contained in:
Rodrigo Moya 2006-01-04 12:38:06 +00:00 committed by Rodrigo Moya
parent 51517c1a72
commit cfe00e5709
3 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-01-04 Rodrigo Moya <rodrigo@novell.com>
* gtk/gtkbindings.c (binding_signal_new): guard against multiplying
by -1 (when n_args is 0).
2006-01-04 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenutoolbutton.c

View File

@ -1,3 +1,8 @@
2006-01-04 Rodrigo Moya <rodrigo@novell.com>
* gtk/gtkbindings.c (binding_signal_new): guard against multiplying
by -1 (when n_args is 0).
2006-01-04 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenutoolbutton.c

View File

@ -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;