projects
/
tools
/
librpm-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f07ab5c
)
Avoid SystemError on inserting an empty list insert to header from python
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 1 Sep 2011 06:40:52 +0000
(09:40 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 1 Sep 2011 06:40:52 +0000
(09:40 +0300)
python/header-py.c
patch
|
blob
|
history
diff --git
a/python/header-py.c
b/python/header-py.c
index
3482dd2
..
6d6c1e9
100644
(file)
--- 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)) {