summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-04-30 00:03:40 +0200
committerJustus Winter <justus@gnupg.org>2016-05-03 17:19:50 +0200
commit8d4db629aa10189d3a545ec1639105cfb9bae650 (patch)
tree5cbd370afe1c15e0d491d4d36261801cd421ccb1
parent45b829f4dcb28a98af7285dc57bfaf621b0bbf21 (diff)
libihash: fix corner case
* libihash/ihash.c (hurd_ihash_locp_find): Set SLOT to NULL if the hash table has not been allocated.
-rw-r--r--libihash/ihash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libihash/ihash.c b/libihash/ihash.c
index ae1cf12a..c6143a57 100644
--- a/libihash/ihash.c
+++ b/libihash/ihash.c
@@ -418,7 +418,10 @@ hurd_ihash_locp_find (hurd_ihash_t ht,
int idx;
if (ht->size == 0)
- return NULL;
+ {
+ *slot = NULL;
+ return NULL;
+ }
idx = find_index (ht, key);
*slot = &ht->items[idx].value;