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:
fa8684d
)
Make it an error to call dbiGetToSet() with NULL keyp
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 9 Jun 2011 08:07:21 +0000
(11:07 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 9 Jun 2011 08:07:21 +0000
(11:07 +0300)
- All current callers always supply non-NULL keyp, and requiring
this gives useful possibilities elsewhere
lib/rpmdb.c
patch
|
blob
|
history
diff --git
a/lib/rpmdb.c
b/lib/rpmdb.c
index
19e999c
..
b041768
100644
(file)
--- 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 (key
p && key
len == 0) {
+ if (keylen == 0) {
keylen = strlen(keyp);
if (keylen == 0)
keylen++; /* XXX "/" fixup */