projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00deac2
)
Fix segfault on rpmstrPoolId() on frozen pool
author
Panu Matilainen
<pmatilai@redhat.com>
Tue, 11 Sep 2012 07:03:51 +0000
(10:03 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Tue, 11 Sep 2012 07:22:18 +0000
(10:22 +0300)
- 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
patch
|
blob
|
history
diff --git
a/rpmio/rpmstrpool.c
b/rpmio/rpmstrpool.c
index
87e025e
..
b38bf29
100644
(file)
--- 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);
}
}