]> 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)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 30 Oct 2025 16:09:10 +0000 (16:09 +0000)
commitef67f64c42d0a8292eaa4d9997d2875549e5d3cb
treefac038acc9895c3410e83af6147c65ab7c425584
parent87974ee767e067b55663a82a191aa5e5cb5dbce6
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