]> git.ipfire.org Git - thirdparty/asterisk.git/commit
channelstorage_cpp_map_name_id: Add read locking around retrievals.
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 1 Oct 2025 14:30:52 +0000 (08:30 -0600)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 6 Oct 2025 13:50:31 +0000 (13:50 +0000)
commitc597c8b5c07772d6ae54b8a21ab2aba285d9d9ed
treeb64778d92873ae435a1520a076655d0a635b130b
parenta6b15bfb685af67701df46274bf1c88d8ec906ab
channelstorage_cpp_map_name_id: Add read locking around retrievals.

When we retrieve a channel from a C++ map, we actually get back a wrapper
object that points to the channel then right after we retrieve it, we bump its
reference count.  There's a tiny chance however that between those two
statements a delete and/or unref might happen which would cause the wrapper
object or the channel itself to become invalid resulting in a SEGV.  To avoid
this we now perform a read lock on the driver around those statements.

Resolves: #1491
main/channelstorage_cpp_map_name_id.cc