[asterisk-dev] [Code Review] 3753: media_formats: Prevent crash during masquerade

Matt Jordan reviewboard at asterisk.org
Fri Jul 11 21:53:03 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3753/
-----------------------------------------------------------

Review request for Asterisk Developers.


Repository: Asterisk


Description
-------

When a masquerade occurs, a newly created channel replaces an existing channel and steals its private data structure. This includes swapping the formats and capabilities.

Since the newly created channel only contains ast_format_none, this causes an assert to fire when the masqueraded channel is destroyed.

Removing the assert isn't a good idea. However, there's also no real need to do the accessing that fires the asserts either: the masqueraded channel will be destroyed, the references will be cleaned up appropriately, and life will go on. free_translation is also called in a channel destructor, and again, things will be cleaned up appropriately without going through the accessors that have the asserts.


Diffs
-----

  /team/group/media_formats-reviewed-trunk/main/channel.c 418435 

Diff: https://reviewboard.asterisk.org/r/3753/diff/


Testing
-------

The crashing test (tests/apps/dial/dial_dtmf_hangup_cancel) now passes


Thanks,

Matt Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140712/04ac403f/attachment.html>


More information about the asterisk-dev mailing list