[sr-dev] git:master: outbound Fix core dump crash

Olle E. Johansson oej at edvina.net
Wed Feb 20 12:30:31 CET 2013


20 feb 2013 kl. 10:37 skrev Peter Dunkley <peter.dunkley at crocodile-rcs.com>:

> Hi Olle,
> 
> I don't think this fix is correct.  The purpose of checking msg->contact is to see if the contact has been parsed already - it does not tell you whether there is a contact in the message or not.
> 
> With this patch Kamailio might not be crashing, but that conditional is now checking the wrong thing.
Somehow it sent a NULL pointer to parse_contact, which should not happen. So you need to check if contact exists before checking if it's parsed. If you need the coredump backtrace or some logs I have it.

/O
> 
> Regards,
> 
> Peter
> 
> On 19 Feb 2013, at 22:10, Olle E. Johansson <oej at edvina.net> wrote:
> 
>> Module: sip-router
>> Branch: master
>> Commit: 6369444761d44526ded2620e33438abb182d2bdc
>> URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6369444761d44526ded2620e33438abb182d2bdc
>> 
>> Author: Olle E. Johansson <oej at edvina.net>
>> Committer: Olle E. Johansson <oej at edvina.net>
>> Date:   Tue Feb 19 23:08:13 2013 +0100
>> 
>> outbound Fix core dump crash
>> 
>> When we got a CANCEL without Contact the parse_contact was sent a null
>> pointer. Changing the "or" to "and" fixed this and Kamailio no longer cores
>> on Cancel coming on over websockets from jssip.
>> 
>> Tested at SIPit 30. Core dumps and backtraces available.
>> Pdunkley - please check this patch
>> 
>> ---
>> 
>> modules/outbound/ob_mod.c |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
>> index caf10f4..f7fd63f 100644
>> --- a/modules/outbound/ob_mod.c
>> +++ b/modules/outbound/ob_mod.c
>> @@ -294,7 +294,7 @@ int use_outbound(struct sip_msg *msg)
>> 
>>   /* Look for ;reg-id in REGISTER Contact-URIs and ;ob in any
>>      Contact-URIs */
>> -    if (msg->contact || parse_headers(msg, HDR_CONTACT_F, 0) != -1)
>> +    if (msg->contact && parse_headers(msg, HDR_CONTACT_F, 0) != -1)
>>   {
>>       if (parse_contact(msg->contact) < 0)
>>       {
>> 
>> 
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




More information about the sr-dev mailing list