[asterisk-bugs] [JIRA] (ASTERISK-22821) Asterisk 12-beta @r402448 pjsip sigsegv receiving SIP MESSAGE when checking Contact header

Anthony Messina (JIRA) noreply at issues.asterisk.org
Sun Nov 3 08:06:02 CST 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-22821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=211461#comment-211461 ] 

Anthony Messina commented on ASTERISK-22821:
--------------------------------------------

According to the lead developer of CSipSimple,

{quote}
OK, seems contact header is not allowed to MESSAGE request
http://www.ietf.org/rfc/rfc3428.txt
Section 9/10.
So I think that asterisk server should not search for this header in MESSAGE at all.... and that it's even expected that *all* standard sip client should make current asterisk code crash when sending a message (as standard client should not include contact header).
{quote}

So perhaps thatcheck for a Contact header should be removed.

I should note however, that I get a very similar core dump when I try to read the Contact header using the PJSIP_HEADER function (but that's a separate issue...)
                
> Asterisk 12-beta @r402448 pjsip sigsegv receiving SIP MESSAGE when checking Contact header
> ------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-22821
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22821
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip_messaging
>    Affects Versions: 12.0.0-beta1
>         Environment: Fedora 19 x86_64, compiled Asterisk and PJSIP from source.
>            Reporter: Anthony Messina
>         Attachments: asterisk-12-r402448-pjsip-message-sigsegv.txt
>
>
> Asterisk dumps core when receiving a PJSIP SIP MESSAGE from a CSipCimple client.  The issue appears when Asterisk attempts to check for a Contact header in the incoming MESSAGE (in res/res_pjsip_messaging.c):
>         /* contact header */
>         if ((size = pjsip_hdr_print_on(pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL), buf, sizeof(buf)-1)) > 0) {
>                 buf[size] = '\0';
>                 CHECK_RES(ast_msg_set_var(msg, "SIP_FULLCONTACT", buf));
>         }
> It may well be that CSipSimple is sending a bad Contact header, but it shouldn't cause Asterisk/PJSIP to bail.  I am contacting the CSipSimple developers to ask about their Contact header.
> If I replace the above snippet with the following, SIP MESSAGEs are processed properly (though I don't know C and I'm not sure this will do what it's supposed to):
>         /* new contact header */
>         pjsip_contact_hdr *contact_hdr;
>         contact_hdr = (pjsip_contact_hdr*)
>                 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL);
>         if (contact_hdr) {
>                 buf[size] = '\0';
>                 CHECK_RES(ast_msg_set_var(msg, "SIP_FULLCONTACT", buf));
>         }
> I will attach a backtrace showing the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list