From: Panu Matilainen Date: Thu, 9 Jun 2011 08:07:21 +0000 (+0300) Subject: Make it an error to call dbiGetToSet() with NULL keyp X-Git-Tag: tznext/4.11.0.1.tizen20130304~1020 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64cbf9dac92599aa967cdc34babf006644b29ef2;p=tools%2Flibrpm-tizen.git 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 --- 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 */