diff options
| author | Paolo Borelli <pborelli@katamail.com> | 2007-11-24 14:18:48 +0000 |
|---|---|---|
| committer | Paolo Borelli <pborelli@src.gnome.org> | 2007-11-24 14:18:48 +0000 |
| commit | be0f8e978dd59e99318925bdf3fea75be97a1710 (patch) | |
| tree | 7794001ab6cc51630270f84f9552c31a61fafb7d /gobject | |
| parent | 5f7e6b2a3c1335b9d54ae82735d66ff4499dd118 (diff) | |
| download | pygobject-be0f8e978dd59e99318925bdf3fea75be97a1710.tar.gz pygobject-be0f8e978dd59e99318925bdf3fea75be97a1710.tar.xz pygobject-be0f8e978dd59e99318925bdf3fea75be97a1710.zip | |
check for NULL before dereferencing.
2007-11-24 Paolo Borelli <pborelli@katamail.com>
* gobject/gobjectmodule.c (pyg_type_register): check for NULL before
dereferencing.
svn path=/trunk/; revision=720
Diffstat (limited to 'gobject')
| -rw-r--r-- | gobject/gobjectmodule.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 9d78bf8..b21087d 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1301,7 +1301,7 @@ pyg_type_register(PyTypeObject *class, const char *type_name) const GInterfaceInfo *iinfo; GInterfaceInfo iinfo_copy; guint parent_interface_iter; - + if (((PyTypeObject *) base)->tp_base != &PyGInterface_Type) continue; @@ -1321,8 +1321,6 @@ pyg_type_register(PyTypeObject *class, const char *type_name) continue; iinfo = pyg_lookup_interface_info(itype); - iinfo_copy = *iinfo; - iinfo_copy.interface_data = class; if (!iinfo) { char *msg; msg = g_strdup_printf("Interface type %s " @@ -1332,6 +1330,9 @@ pyg_type_register(PyTypeObject *class, const char *type_name) g_free(msg); continue; } + + iinfo_copy = *iinfo; + iinfo_copy.interface_data = class; g_type_add_interface_static(instance_type, itype, &iinfo_copy); } } else @@ -1392,7 +1393,7 @@ pyg_type_register(PyTypeObject *class, const char *type_name) const GInterfaceInfo *iinfo; GInterfaceInfo iinfo_copy; guint parent_interface_iter; - + if (((PyTypeObject *) base)->tp_base != &PyGInterface_Type) continue; @@ -1413,8 +1414,6 @@ pyg_type_register(PyTypeObject *class, const char *type_name) } iinfo = pyg_lookup_interface_info(itype); - iinfo_copy = *iinfo; - iinfo_copy.interface_data = class; if (!iinfo) { char *msg; msg = g_strdup_printf("Interface type %s " @@ -1424,6 +1423,9 @@ pyg_type_register(PyTypeObject *class, const char *type_name) g_free(msg); continue; } + + iinfo_copy = *iinfo; + iinfo_copy.interface_data = class; g_type_add_interface_static(instance_type, itype, &iinfo_copy); } } else |
