summaryrefslogtreecommitdiff
path: root/python/rpmts-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-22 19:19:02 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-22 19:19:02 +0300
commitda74188fa654246ec74e0375440f326e5dc714f2 (patch)
tree81ab358d268b42147278025a23e8a1c701a98c3d /python/rpmts-py.c
parent00d683ce88748080ce78d1e2d802a401b2d30261 (diff)
downloadlibrpm-tizen-da74188fa654246ec74e0375440f326e5dc714f2.tar.gz
librpm-tizen-da74188fa654246ec74e0375440f326e5dc714f2.tar.bz2
librpm-tizen-da74188fa654246ec74e0375440f326e5dc714f2.zip
Sanitize python object -> tag number exception handling
- raise exception in tagNumFromPyObject(), not in 12 different callers - check against RPMTAG_NOT_FOUND consistently instead of -1 and whatnot - unknown tags are value, not key or type errors
Diffstat (limited to 'python/rpmts-py.c')
-rw-r--r--python/rpmts-py.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 355e2f9f6..7fd3172d6 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -1079,8 +1079,7 @@ fprintf(stderr, "*** rpmts_Match(%p) ts %p\n", s, s->ts);
&TagN, &Key))
return NULL;
- if (TagN && (tag = tagNumFromPyObject (TagN)) == -1) {
- PyErr_SetString(PyExc_TypeError, "unknown tag type");
+ if (TagN && (tag = tagNumFromPyObject (TagN)) == RPMTAG_NOT_FOUND) {
return NULL;
}