diff options
author | Ricardo Jorge <rvelhote@gmail.com> | 2009-08-04 00:03:04 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-08-04 00:18:43 +0200 |
commit | 3641978dfa88398dbc494845fe611dd87f2317b7 (patch) | |
tree | 8d9b92ebe8846036c74ea0cda286d1d928a9d097 /source4 | |
parent | 1174177c8f5851762ab0d3724df9efbdc0f34b1c (diff) | |
download | samba-3641978dfa88398dbc494845fe611dd87f2317b7.tar.gz samba-3641978dfa88398dbc494845fe611dd87f2317b7.tar.bz2 samba-3641978dfa88398dbc494845fe611dd87f2317b7.zip |
param/pyparam: Cope with string list parameters being empty.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/param/pyparam.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 37e882e1cc..58799f8d37 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -129,7 +129,13 @@ static PyObject *py_lp_ctx_get_helper(struct loadparm_context *lp_ctx, const cha { int j; const char **strlist = *(const char ***)parm_ptr; - PyObject *pylist = PyList_New(str_list_length(strlist)); + PyObject *pylist; + + if(strlist == NULL) { + return PyList_New(0); + } + + pylist = PyList_New(str_list_length(strlist)); for (j = 0; strlist[j]; j++) PyList_SetItem(pylist, j, PyString_FromString(strlist[j])); |