[asterisk-dev] [Code Review] 3267: pjsip: avoid edge case potential crash in answer()

Mark Michelson reviewboard at asterisk.org
Wed Feb 26 10:13:27 CST 2014



> On Feb. 26, 2014, 3:52 p.m., Joshua Colp wrote:
> > /branches/12/channels/chan_pjsip.c, line 448
> > <https://reviewboard.asterisk.org/r/3267/diff/1/?file=54579#file54579line448>
> >
> >     This log message doesn't fit in with the rest of the messages in PJSIP land, and this can occur for non-header reasons. To copy/paste my own commit message:
> >     
> >     If a response to an initial incoming INVITE results in a transport error
> >     the INVITE transaction is removed from the INVITE session. Any attempts
> >     to answer the INVITE session after this results in a crash as it requires
> >     the INVITE transaction to exist. This change explicitly locks the dialog
> >     and checks to ensure that the INVITE transaction exists before answering.
> >

In addition, I'd steer clear of referring to struct fields in log messages since users won't have a clue what you are referring to. A somewhat higher-level way of stating the same thing would be:

"Cannot answer incoming call because there is no associated SIP transaction."


- Mark


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


On Feb. 25, 2014, 7:45 p.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3267/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2014, 7:45 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When accidentally compiling asterisk against a rogue pjproject installation that had a slightly different definition pjsip_inv_session structure, the invite_tsx structure could appear null when answer() is called.  This led to a crash because ast_sip_session_send_response would be called with an uninitialized packet.
> 
> This patch corrects the uninitialized packet to prevent the crash, and adds a diagnostic message to aid in discovering the cause of the problem (in this case, remove /usr/local/include/pj* to resolve conflicting structure).
> 
> 
> Diffs
> -----
> 
>   /branches/12/channels/chan_pjsip.c 408931 
> 
> Diff: https://reviewboard.asterisk.org/r/3267/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

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


More information about the asterisk-dev mailing list