pipewire/test
Peter Hutterer 626d30e4bd map: fix free_list corruption when re-using removed ids
Re-using an id after removing it is a bug in the caller but there are
two cases where we corrupt the free list without warning:

Removing an object twice:

   id = pw_map_insert_new(object);
   pw_map_remove(map, id);
   pw_map_remove(map, id);

And inserting an element at an index previously removed:

   id = pw_map_insert_new(object);
   pw_map_remove(map, id);
   pw_map_insert_at(map, id, new_object);

The latter is arguably valid code, or at least it'll look like it's
valid code.

For both cases, check if the id to remove/insert at is a free item and
handle that accordingly.
2021-10-08 12:40:23 +10:00
..
meson.build test: add some map tests 2021-10-08 12:40:23 +10:00
pwtest-compat.c test: add sigabbrev_np() for systems where it's not available 2021-06-10 15:13:57 +10:00
pwtest-implementation.h test: add errno check macros 2021-06-09 18:00:06 +10:00
pwtest.c test: fix the environment variable name to disable systemd logging 2021-09-24 12:33:15 +10:00
pwtest.h fix codespell issues 2021-10-07 15:26:18 +00:00
test-array.c array: re-initialize the array in pw_array_clear() 2021-10-07 15:08:57 +10:00
test-client.c test: move the client and utils tests over here 2021-08-04 07:45:06 +00:00
test-config.c test: fix a memleak in the config tests 2021-07-07 11:03:23 +00:00
test-context.c test: remove duplicate test invocation 2021-07-06 07:14:21 +00:00
test-example.c meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-lib.c meson.build: drop HAVE_CONFIG_H 2021-06-10 09:04:16 +10:00
test-logger.c log: add topic loggers and a default topic 2021-09-28 09:35:38 +02:00
test-map.c map: fix free_list corruption when re-using removed ids 2021-10-08 12:40:23 +10:00
test-properties.c test: move some of the property tests to pwtest 2021-06-17 07:08:53 +00:00
test-pwtest.c test: add sigabbrev_np() for systems where it's not available 2021-06-10 15:13:57 +10:00
test-spa-buffer.c test: convert two spa tests to pwtest 2021-06-09 18:00:39 +10:00
test-spa-json.c test: convert two spa tests to pwtest 2021-06-09 18:00:39 +10:00
test-spa-log.c tests: fix log test 2021-09-29 17:06:35 +02:00
test-spa-node.c test: replace all spa_assert() macros with spa_assert_se() 2021-07-27 10:24:44 +10:00
test-spa-pod.c test: replace all spa_assert() macros with spa_assert_se() 2021-07-27 10:24:44 +10:00
test-spa-utils.c spa: add a macro to check for a callback version 2021-09-28 09:35:38 +02:00
test-support.c test: add a test for the logger truncation 2021-06-09 18:00:39 +10:00
test-utils.c test: move the client and utils tests over here 2021-08-04 07:45:06 +00:00