[asterisk-dev] [Code Review] 2843: res_pjsip: crash when using localnet and external_signaling_address options
Mark Michelson
reviewboard at asterisk.org
Thu Sep 26 09:40:32 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2843/#review9791
-----------------------------------------------------------
branches/12/include/asterisk/res_pjsip.h
<https://reviewboard.asterisk.org/r/2843/#comment18997>
Rather than taking in a pointer to the structure that has a mod_data, take the mod_data array itself. That way, PJSIP structures without a mod_data field (like pjsip_rx_data) will not be incompatible with this macro.
branches/12/include/asterisk/res_pjsip.h
<https://reviewboard.asterisk.org/r/2843/#comment18996>
I think this needs a bit of modification. The problem is that this assumes that p has a member called "pool". You'll run into an issue the first time that you try to pass in a pjsip_inv_session since it has two pools, pool_active, and pool_prov. The same could also potentially happen with p->mod_data (pjsip_rx_data does not have a mod_data field on it.).
I think a better way to do this would be to define the macro so that it takes in a pool, a mod_data array, an id, a key, and a value.
- Mark Michelson
On Sept. 12, 2013, 4:29 p.m., Kevin Harwell wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2843/
> -----------------------------------------------------------
>
> (Updated Sept. 12, 2013, 4:29 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-22394
> https://issues.asterisk.org/jira/browse/ASTERISK-22394
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> There was a collision of mod_data use on the transaction between using a nat hook and an session response callback. During state change it was assumed what was in the mod_data was nothing or the response callback. However, it was possible for it to also contain a nat hook thus resulting in a bad cast and a crash.
>
> Added the ability to store multiple data elements in mod_data via a hash table. In this instance, mod_data now stores a hash table of the two values that can be retrieved using an associated string key.
>
>
> Diffs
> -----
>
> branches/12/include/asterisk/res_pjsip.h 398800
> branches/12/res/res_pjsip.c 398800
> branches/12/res/res_pjsip.exports.in 398800
> branches/12/res/res_pjsip_session.c 398800
>
> Diff: https://reviewboard.asterisk.org/r/2843/diff/
>
>
> Testing
> -------
>
> Configured pjsip and made several calls to make sure the crash no longer occurred and everything still worked as expected with and without using the localnet and external_signaling_address_option(s).
>
>
> Thanks,
>
> Kevin Harwell
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130926/e18b4819/attachment-0001.html>
More information about the asterisk-dev
mailing list