From 2bda849bf9b39b423175d1ee1d8796b856cc9988 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 7 Jan 2018 19:30:42 -0500 Subject: detect pkghash allocation failure If rehash ever failed with a full hash it would return the old hash that is already full. get_hash_position would then loop forever because it would never find an empty bucket. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/pkghash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/pkghash.h') diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h index dd163346..a5c02c19 100644 --- a/lib/libalpm/pkghash.h +++ b/lib/libalpm/pkghash.h @@ -49,8 +49,8 @@ typedef struct __alpm_pkghash_t alpm_pkghash_t; alpm_pkghash_t *_alpm_pkghash_create(unsigned int size); -alpm_pkghash_t *_alpm_pkghash_add(alpm_pkghash_t *hash, alpm_pkg_t *pkg); -alpm_pkghash_t *_alpm_pkghash_add_sorted(alpm_pkghash_t *hash, alpm_pkg_t *pkg); +alpm_pkghash_t *_alpm_pkghash_add(alpm_pkghash_t **hash, alpm_pkg_t *pkg); +alpm_pkghash_t *_alpm_pkghash_add_sorted(alpm_pkghash_t **hash, alpm_pkg_t *pkg); alpm_pkghash_t *_alpm_pkghash_remove(alpm_pkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data); void _alpm_pkghash_free(alpm_pkghash_t *hash); -- cgit v1.2.3-54-g00ecf