Przeglądaj źródła

sca: fix core when HDR_CSEQ not parsed

> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00007f1820227bae in sca_call_info_update (msg=0x7f1828635930, p1=0x0, p2=0x0, p3=0x7f1828635930 "\001") at sca_call_info.c:1845
> 1845			LM_DBG("BUG: sca module does not support Call-Info headers "
> (gdb) p msg->cseq
> $1 = (struct hdr_field *) 0x0
> (gdb) p msg->first_line.u.request->method
> $2 = {
>  s = 0xa33540 <buf> "SUBSCRIBE sip:[email protected]:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 172.17.0.2:5061;branch=z9hG4bK-2884-1-0\r\nFrom: sipp <sip:[email protected]:5061>;tag=2884SIPpTag001\r\nTo: sut <sip:[email protected]:5060>\r\nCall-ID: 1"..., len = 9}
Victor Seva 9 lat temu
rodzic
commit
1ea49ee2d4
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      modules/sca/sca_call_info.c

+ 6 - 0
modules/sca/sca_call_info.c

@@ -1842,6 +1842,12 @@ int sca_call_info_update(sip_msg_t *msg, char *p1, char *p2, char *p3)
 		}
 	}
 	if (i >= n_dispatch) {
+		if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) ||
+			(msg->cseq==NULL)))
+		{
+			LM_ERR("no CSEQ header\n");
+			return (1);
+		}
 		LM_DBG("BUG: sca module does not support Call-Info headers "
 				"in %.*s requests\n", STR_FMT(&get_cseq(msg)->method));
 		return (1);