mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-27 13:09:36 +00:00
switch_channel_get_partner_uuid_copy() read signal_bond and originate_signal_bond with dup set, so every call copied the uuid into the session pool before copying it into the caller's buffer. The read path calls it for each comfort-noise frame of a bridged leg, so the pool grew by 40 bytes per frame until hangup. The lookups now return the channel's own value, which stays valid under profile_mutex while it is copied. The copy used strncpy(), which leaves the buffer without a terminating NUL when the value is as long as the buffer or longer. switch_copy_string() cuts the value to fit and always terminates it. With RTCP passthru, every received RTCP packet looked the partner up with switch_channel_get_partner_uuid(), which copies the uuid into the session pool, so the pool grew with each packet until hangup. The lookup now copies the uuid into a stack buffer with switch_channel_get_partner_uuid_copy().