From 51f1cff50d7561adfc71a38085af38e3bf261a4f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 11 Sep 2012 10:03:51 +0300 Subject: 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... --- rpmio/rpmstrpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rpmio') 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); } } -- cgit v1.2.3