diff options
author | John Finlay <finlay@src.gnome.org> | 2004-11-08 04:13:50 +0000 |
---|---|---|
committer | John Finlay <finlay@src.gnome.org> | 2004-11-08 04:13:50 +0000 |
commit | 58494df95c1354771f980b89643f72afd84d5017 (patch) | |
tree | 6e6556c1c37f3002669628a7e892f969d6a5098d | |
parent | 4ef21498e99f2efe930e92a09c83c1d2903dea83 (diff) | |
download | pygobject-58494df95c1354771f980b89643f72afd84d5017.tar.gz pygobject-58494df95c1354771f980b89643f72afd84d5017.tar.xz pygobject-58494df95c1354771f980b89643f72afd84d5017.zip |
gobject/gobjectmodule.c (_pyg_strv_from_gvalue) Avoid segfault when argv
* gobject/gobjectmodule.c (_pyg_strv_from_gvalue) Avoid segfault
when argv is NULL.
-rw-r--r-- | gobject/gobjectmodule.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 434e6ba..592e7b2 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1738,10 +1738,13 @@ static PyObject * _pyg_strv_from_gvalue(const GValue *value) { gchar **argv = (gchar **) g_value_get_boxed(value); - int argc, i; + int argc = 0, i; PyObject *py_argv; - for (argc = -1; argv[++argc];); + if (argv) { + while (argv[argc]) + argc++; + } py_argv = PyList_New(argc); for (i = 0; i < argc; ++i) PyList_SET_ITEM(py_argv, i, PyString_FromString(argv[i])); |