summaryrefslogtreecommitdiff
path: root/gtk/gtkcontainer.override
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2006-04-13 17:20:31 +0000
committerJohan Dahlin <johan@src.gnome.org>2006-04-13 17:20:31 +0000
commit3198b850c5eca25192e413848e8de9c5026d12b1 (patch)
tree4901ebf20f920d9470c6ca6f35868a5115177bab /gtk/gtkcontainer.override
parent2475217b27b03993420494c4aea8e8315dd8412f (diff)
downloadpygtk-3198b850c5eca25192e413848e8de9c5026d12b1.tar.gz
Set an exception and jump out (Coverity)
* gtk/gtkcontainer.override (pygtk_container_for_common): Set an exception and jump out (Coverity) * gtk/gtk.override (_wrap_gtk_stock_list_ids): Decref py_item after using it (Coverity)
Diffstat (limited to 'gtk/gtkcontainer.override')
-rw-r--r--gtk/gtkcontainer.override6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkcontainer.override b/gtk/gtkcontainer.override
index 87f06dfb..6d007433 100644
--- a/gtk/gtkcontainer.override
+++ b/gtk/gtkcontainer.override
@@ -526,7 +526,10 @@ pygtk_container_for_common(PyGObject *self, PyObject *args, unsigned for_index)
{ "O|O:GtkContainer.forall", gtk_container_forall }
};
- g_assert(for_index < countof(table));
+ if (for_index >= countof(table)) {
+ PyErr_SetString(PyExc_TypeError, "for_index > 2");
+ return NULL;
+ }
if (!PyArg_ParseTuple(args, table[for_index].parse_arg,
&pyfunc, &pyarg))
@@ -537,7 +540,6 @@ pygtk_container_for_common(PyGObject *self, PyObject *args, unsigned for_index)
table[for_index].for_func(GTK_CONTAINER(self->obj),
pygtk_container_for_common_marshal,
&cunote);
-
Py_INCREF(Py_None);
return Py_None;
}