]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Move ast_rtp_rtcp_report_alloc using `rtp->themssrc_valid` into...
authorzhengsh <zhengsh@ti-net.com.cn>
Fri, 30 Jun 2023 10:39:20 +0000 (18:39 +0800)
committerzhengsh <zhengsh@ti-net.com.cn>
Wed, 12 Jul 2023 15:56:17 +0000 (15:56 +0000)
commit25a766f49df0d8ca5bc7bdb4c8b09ddfc0d703db
treedcef918eb1a27c7c94dda77c2461c1f8c581cdd3
parent0f9de8a3f01c865b66e02b4b17f062fc96297dbb
res_rtp_asterisk: Move ast_rtp_rtcp_report_alloc using `rtp->themssrc_valid` into the scope of the rtp_instance lock.

From the gdb information, it was found that when calling __ast_free, the size of the
allocated space pointed to by the pointer matches the size created when rtp->themssrc_valid
is equal to 0. However, in reality, when reading the value of rtp->themssrc_valid in gdb,
it is found to be 1.

Within ast_rtcp_write(), the call to ast_rtp_rtcp_report_alloc() uses rtp->themssrc_valid,
which is outside the protection of the rtp_instance lock. However,
ast_rtcp_generate_report(), which is called by ast_rtcp_generate_compound_prefix(), uses
rtp->themssrc_valid within the protection of the rtp_instance lock.

This can lead to the possibility that the value of rtp->themssrc_valid used in the call to
ast_rtp_rtcp_report_alloc() may be different from the value of rtp->themssrc_valid used
within ast_rtcp_generate_report().

Resolves: asterisk#63
res/res_rtp_asterisk.c