]> 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)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Wed, 12 Jul 2023 15:56:24 +0000 (15:56 +0000)
commitd3c4f93ca6ca7941a63ec1722e35cf5d5e2a2db5
tree4c4c3b4dc1a1f9d2f533fd03a143f2be439b825e
parentdd171a44b7d53d1568f5a3627c527055c5da45d5
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