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

George Joseph reviewboard at asterisk.org
Wed Oct 1 17:45:16 CDT 2014


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

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/20141001/b6b24686/attachment.html>


More information about the asterisk-dev mailing list