diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-09-01 09:40:52 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-09-01 09:40:52 +0300 |
commit | 8fb5d95eda38c282a03eb1db891de695e51cb67b (patch) | |
tree | 803eb2addb69c8f9d362c2939848150a27f06d6a /python | |
parent | f07ab5c1afa9b0b7105082a8617ec6a7657fc27e (diff) | |
download | librpm-tizen-8fb5d95eda38c282a03eb1db891de695e51cb67b.tar.gz librpm-tizen-8fb5d95eda38c282a03eb1db891de695e51cb67b.tar.bz2 librpm-tizen-8fb5d95eda38c282a03eb1db891de695e51cb67b.zip |
Avoid SystemError on inserting an empty list insert to header from python
Diffstat (limited to 'python')
-rw-r--r-- | python/header-py.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/header-py.c b/python/header-py.c index 3482dd2a8..6d6c1e9ae 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -510,6 +510,8 @@ static int validData(rpmTagVal tag, rpmTagType type, rpmTagReturnType retype, Py } else if (retype == RPM_ARRAY_RETURN_TYPE && PyList_Check(value)) { /* python lists can contain arbitrary objects, validate each item */ Py_ssize_t len = PyList_Size(value); + if (len == 0) + valid = 0; for (Py_ssize_t i = 0; i < len; i++) { PyObject *item = PyList_GetItem(value, i); if (!validItem(tclass, item)) { |