Pārlūkot izejas kodu

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
Olle E. Johansson 12 gadi atpakaļ
vecāks
revīzija
6369444761
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      modules/outbound/ob_mod.c

+ 1 - 1
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)
 		{