summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-11 10:03:51 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-11 10:22:18 +0300
commit51f1cff50d7561adfc71a38085af38e3bf261a4f (patch)
tree295a1e22ed48291e71720c81f215d5f96a317109 /rpmio
parent00deac224c023d5195a0795e4e9367fad6e85cee (diff)
downloadlibrpm-tizen-51f1cff50d7561adfc71a38085af38e3bf261a4f.tar.gz
librpm-tizen-51f1cff50d7561adfc71a38085af38e3bf261a4f.tar.bz2
librpm-tizen-51f1cff50d7561adfc71a38085af38e3bf261a4f.zip
Fix segfault on rpmstrPoolId() on frozen pool
- String -> id lookups need the hash table in place even if we're not adding. We could do a linear search in such a case but...
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmstrpool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c
index 87e025ec7..b38bf29f4 100644
--- a/rpmio/rpmstrpool.c
+++ b/rpmio/rpmstrpool.c
@@ -125,12 +125,12 @@ rpmsid rpmstrPoolIdn(rpmstrPool pool, const char *s, size_t slen, int create)
{
rpmsid sid = 0;
- if (pool && s) {
+ if (pool && pool->hash && s) {
unsigned int hash = strHashKeyHash(pool->hash, s);
rpmsid *sids;
if (strHashGetHEntry(pool->hash, s, hash, &sids, NULL, NULL)) {
sid = sids[0];
- } else if (create && pool->hash) {
+ } else if (create) {
sid = rpmstrPoolPut(pool, s, slen, hash);
}
}