From 64cbf9dac92599aa967cdc34babf006644b29ef2 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 9 Jun 2011 11:07:21 +0300 Subject: [PATCH] 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 --- lib/rpmdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 19e999c..b041768 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 */ -- 2.7.4