[asterisk-dev] [Code Review] res_xmpp: Fix a segfault occuring with bodyless messages during JABBER_RECEIVE function.
Joshua Colp
reviewboard at asterisk.org
Wed Sep 12 13:10:38 CDT 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2108/#review7049
-----------------------------------------------------------
/branches/11/res/res_xmpp.c
<https://reviewboard.asterisk.org/r/2108/#comment13650>
You can optimize this further by checking for the body at the start of this function and storing the result. If there is no body don't even allocate a message. If there is a body continue like normal, and duplicate the stored body pointer.
- Joshua
On Sept. 12, 2012, 12:26 p.m., jrose wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2108/
> -----------------------------------------------------------
>
> (Updated Sept. 12, 2012, 12:26 p.m.)
>
>
> Review request for Asterisk Developers and jcolp.
>
>
> Summary
> -------
>
> Without this patch, Asterisk would receive an empty message (occurs when typing but not actually entering a message into clients like Trillian and Jabber) and this would reach ast_strdupa(message->message) causing a segfault. This patch works by preventing new messages from being finalized and entered into the message list if the body of that message is blank.
>
>
> This addresses bug ASTERISK-20361.
> https://issues.asterisk.org/jira/browse/ASTERISK-20361
>
>
> Diffs
> -----
>
> /branches/11/res/res_xmpp.c 372832
>
> Diff: https://reviewboard.asterisk.org/r/2108/diff
>
>
> Testing
> -------
>
> Noah confirmed that the patch averted his segfault problems while continuing to function normally.
>
>
> Thanks,
>
> jrose
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120912/b4396936/attachment-0001.htm>
More information about the asterisk-dev
mailing list