From e2e94ca47c5fc8b52ec28d9811a6da199a2c7262 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 31 Jul 2006 21:53:21 +0000 Subject: fix bad memory access if a non-existing entry shall be removed from a pa_idxset by index git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1173 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/idxset.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pulsecore/idxset.c') diff --git a/src/pulsecore/idxset.c b/src/pulsecore/idxset.c index 5c79767d..23fe0b5a 100644 --- a/src/pulsecore/idxset.c +++ b/src/pulsecore/idxset.c @@ -286,6 +286,9 @@ void* pa_idxset_remove_by_index(pa_idxset*s, uint32_t idx) { if (!(a = array_index(s, idx))) return NULL; + if (!*a) + return NULL; + data = (*a)->data; remove_entry(s, *a); -- cgit