summaryrefslogtreecommitdiff
path: root/lib/rpmdb.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:26:32 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-06-09 11:26:32 +0300
commitf8c35a5768d6815a67d14bf0045ee0dd180a6798 (patch)
tree4faac581b9b0aa3411315e5b5a5667843985a4a8 /lib/rpmdb.c
parent64cbf9dac92599aa967cdc34babf006644b29ef2 (diff)
downloadlibrpm-tizen-f8c35a5768d6815a67d14bf0045ee0dd180a6798.tar.gz
librpm-tizen-f8c35a5768d6815a67d14bf0045ee0dd180a6798.tar.bz2
librpm-tizen-f8c35a5768d6815a67d14bf0045ee0dd180a6798.zip
Only honor keylen if keyp is also specified
Diffstat (limited to 'lib/rpmdb.c')
-rw-r--r--lib/rpmdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index b0417688a..eb7260729 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -455,8 +455,10 @@ static int dbiCursorGetToSet(dbiCursor dbc, const char *keyp, size_t keylen,
memset(&data, 0, sizeof(data));
memset(&key, 0, sizeof(key));
- key.data = (void *) keyp; /* discards const */
- key.size = keylen;
+ if (keyp) {
+ key.data = (void *) keyp; /* discards const */
+ key.size = keylen;
+ }
rc = dbiCursorGet(dbc, &key, &data, DB_SET);