Behdad Esfahbod and Claude Opus 4.8
2f8fb68973
[map] Fix use-after-free when updating a map from itself
...
hb_hashmap_t::update() iterates other's items array while inserting
each pair into *this with set(). When other is *this and occupancy
sits on a growth threshold (5 of 8, 10 of 16, ...), the first set()
calls alloc(), which frees the items array the iterator is still
walking, so the rest of the loop reads freed memory. The existing
in_storage() guard only protects set()'s own key/value references,
not this iterator.
Merging a map into itself cannot change it, so make update() a no-op
in that case with an early &other == this return, mirroring the
self-check in hb_vector_t. hb_map_update() is the only caller.
Regression tests are added in src/test-map.cc (including the tombstone
case at 42 used / 10 live slots) and test/api/test-map.c; both fail
under ASan without the fix.
Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-7TMM2Z2T.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-10-30 16:35:27 -06:00
..
2025-02-26 14:41:04 -07:00
2026-10-30 16:10:52 -06:00
2026-07-12 22:20:21 +03:00
2026-10-21 18:13:19 -06:00
2026-10-15 11:16:49 -06:00
2026-10-22 13:04:52 -06:00
2026-10-21 19:58:41 -06:00
2026-10-27 15:42:35 -06:00
2026-10-30 16:10:52 -06:00
2026-10-28 00:03:22 +05:30
2026-10-30 14:53:51 -06:00
2026-10-14 10:51:09 -06:00
2026-10-10 04:04:32 -06:00
2025-04-06 03:49:15 -06:00
2025-07-02 20:14:51 +03:00
2026-10-20 11:25:59 -06:00
2025-04-06 03:49:15 -06:00
2025-04-06 03:49:15 -06:00
2026-10-29 19:28:41 -06:00
2026-10-02 11:22:24 -06:00
2026-10-22 19:31:32 +03:00
2026-10-01 16:51:20 -06:00
2025-04-06 18:08:50 -06:00
2026-10-10 16:58:18 -06:00
2025-04-06 03:49:15 -06:00
2026-10-30 14:53:31 -06:00
2026-06-24 03:00:52 -06:00
2026-06-02 02:33:52 -06:00
2025-04-25 19:04:37 -06:00
2026-01-10 07:42:07 -07:00
2025-03-23 15:40:41 +02:00
2026-10-02 18:01:26 -06:00
2026-10-18 19:54:45 -06:00
2026-07-30 19:02:25 -06:00
2025-04-06 03:49:15 -06:00
2021-11-01 17:59:48 -07:00
2026-10-16 12:18:00 -06:00
2026-10-30 15:01:04 -06:00
2026-09-10 14:54:07 -06:00
2026-04-18 19:54:54 -06:00
2026-10-30 15:07:23 -06:00
2026-08-22 12:48:13 -06:00
2026-10-27 15:42:35 -06:00
2026-10-30 16:35:27 -06:00
2025-04-06 03:49:15 -06:00
2025-04-06 19:16:43 -06:00
2026-10-30 15:04:54 -06:00
2025-04-06 03:49:15 -06:00
2026-10-29 15:42:53 -07:00
2026-10-27 13:44:40 -07:00
2026-10-21 19:58:41 -06:00
2026-09-04 14:14:49 -06:00
2026-07-31 04:31:26 +03:00
2025-04-06 03:49:15 -06:00
2026-10-01 20:40:06 -06:00
2025-04-05 22:37:10 -06:00
2025-04-06 03:49:15 -06:00
2019-08-13 21:02:47 -07:00
2026-10-14 10:51:09 -06:00
2026-10-29 18:52:24 -06:00
2025-04-05 22:37:10 -06:00
2026-07-08 00:53:56 -06:00
2026-07-21 18:47:36 -06:00
2026-10-30 14:52:35 -06:00
2026-10-29 19:07:51 -06:00
2026-10-07 12:19:48 -06:00
2026-10-20 11:25:59 -06:00
2026-10-16 11:01:47 -06:00
2026-08-12 17:17:00 -06:00
2024-02-10 07:08:18 -07:00
2026-08-15 11:43:02 -06:00
2020-01-31 16:37:30 -05:00
2026-10-30 16:10:52 -06:00
2026-10-22 17:06:10 +03:00
2026-10-02 21:33:22 -06:00
2026-10-18 15:26:44 -06:00
2025-04-06 03:49:15 -06:00
2026-10-22 12:55:36 -06:00
2026-10-05 18:04:26 -06:00
2026-10-01 14:47:15 -06:00
2025-04-06 03:49:15 -06:00
2026-06-05 13:35:05 +02:00
2021-07-29 18:30:27 -07:00
2026-10-11 00:41:07 -06:00
2025-04-06 02:34:48 -06:00
2018-10-21 11:27:05 +03:30
2018-10-21 11:27:05 +03:30
2026-10-29 20:56:03 -06:00
2020-01-15 13:36:01 -08:00
2026-10-11 00:38:36 -06:00
2018-10-21 11:27:05 +03:30
2021-07-29 18:30:27 -07:00
2026-10-29 21:01:05 -06:00
2026-09-17 00:37:58 +03:00
2025-06-08 13:43:27 +03:00
2025-04-06 03:49:15 -06:00