diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-09-11 10:03:51 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-09-11 10:22:18 +0300 |
commit | 51f1cff50d7561adfc71a38085af38e3bf261a4f (patch) | |
tree | 295a1e22ed48291e71720c81f215d5f96a317109 | |
parent | 00deac224c023d5195a0795e4e9367fad6e85cee (diff) | |
download | librpm-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...
-rw-r--r-- | rpmio/rpmstrpool.c | 4 |
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); } } |