summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:07:21 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:07:21 +0300
commit64cbf9dac92599aa967cdc34babf006644b29ef2 (patch)
tree9e9b65445a3a6b8314b88013583ce8e22978578b
parentfa8684da9200c6b1e2a1d3686f55de915fc9f545 (diff)
downloadlibrpm-tizen-64cbf9dac92599aa967cdc34babf006644b29ef2.tar.gz
librpm-tizen-64cbf9dac92599aa967cdc34babf006644b29ef2.tar.bz2
librpm-tizen-64cbf9dac92599aa967cdc34babf006644b29ef2.zip
Make it an error to call dbiGetToSet() with NULL keyp
- All current callers always supply non-NULL keyp, and requiring this gives useful possibilities elsewhere
-rw-r--r--lib/rpmdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 19e999cbb..b0417688a 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -475,10 +475,10 @@ static int dbiGetToSet(dbiIndex dbi, const char *keyp, size_t keylen,
dbiIndexSet *set)
{
int rc = EINVAL;
- if (dbi != NULL) {
+ if (dbi != NULL && keyp != NULL) {
dbiCursor dbc = dbiCursorInit(dbi, 0);
- if (keyp && keylen == 0) {
+ if (keylen == 0) {
keylen = strlen(keyp);
if (keylen == 0)
keylen++; /* XXX "/" fixup */