[asterisk-dev] [Code Review] 4164: res_pjsip_outbound_registration: stack overflow when using non-default sorcery wizard

Kevin Harwell reviewboard at asterisk.org
Tue Nov 11 14:55:48 CST 2014



> On Nov. 11, 2014, 11:09 a.m., Mark Michelson wrote:
> > branches/12/res/res_pjsip_outbound_registration.c, lines 1315-1324
> > <https://reviewboard.asterisk.org/r/4164/diff/2/?file=68818#file68818line1315>
> >
> >     This has the possibility to return two different types. Retrieving a registration from sorcery will retrieve a sip_outbound_registration. Finding an object in the current_states container will get a sip_oubound_registration_state

Actually it only returns the registration or NULL.  The call to ao2_find is an attempt to remove the state from current_states if no registration exists.  However as this may be unclear I added a comment.


- Kevin


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


On Nov. 10, 2014, 5:35 p.m., Kevin Harwell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4164/
> -----------------------------------------------------------
> 
> (Updated Nov. 10, 2014, 5:35 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24514
>     https://issues.asterisk.org/jira/browse/ASTERISK-24514
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When using a non-default sorcery wizard (in this instance realtime) for outbound registrations and after adding in an appropriate call to ast_sorcery_apply_config() (since it is missing) Asterisk will crash after a stack overflow occurs due to the code infinitely recursing.  The fix entails removing the outbound registration state dependency from the outbound registration sorcery object and instead keeping an in memory container that can be used to lookup the state when needed.
> 
> 
> Diffs
> -----
> 
>   branches/12/res/res_pjsip_outbound_registration.c 427675 
> 
> Diff: https://reviewboard.asterisk.org/r/4164/diff/
> 
> 
> Testing
> -------
> 
> On top of running the current testsuite tests I also manually tested various configurations and scenarios using a static configuration file as well as dynamic realtime.  Verified that the crash no longer occurs and the potentially affected functionality works as expected (for instance, cli/ami commands, module [re]loading, and manual unregistration).
> 
> 
> Thanks,
> 
> Kevin Harwell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141111/f5c8e72a/attachment-0001.html>


More information about the asterisk-dev mailing list