[asterisk-dev] [Code Review] 4044: sorcery: Prevent segfault in sorcery_wizard_create when there's no create virtual function

Matt Jordan reviewboard at asterisk.org
Fri Oct 3 03:18:04 CDT 2014


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

Ship it!


Ship It!

- Matt Jordan


On Oct. 1, 2014, 5:45 p.m., George Joseph wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4044/
> -----------------------------------------------------------
> 
> (Updated Oct. 1, 2014, 5:45 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When you call ast_sorcery_create() you don't necessarily know which wizard is going to be invoked.  If it happens to be a wizard like 'config' that doesn't have a 'create' virtual function you get a segfault in the sorcery_wizard_create callback.  This patch catches the null function pointer, does an ast_assert, and logs an error.
> 
> 
> Diffs
> -----
> 
>   branches/12/main/sorcery.c 424332 
> 
> Diff: https://reviewboard.asterisk.org/r/4044/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> George Joseph
> 
>

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


More information about the asterisk-dev mailing list