[sr-dev] git:5.1:12ddd127: dialog: check CSeq careful with track_cseq_updates

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 5 12:12:29 CEST 2018


Module: kamailio
Branch: 5.1
Commit: 12ddd127343f1be98a4556aadd9ccfeafc3fbdc7
URL: https://github.com/kamailio/kamailio/commit/12ddd127343f1be98a4556aadd9ccfeafc3fbdc7

Author: Dmitri Savolainen <savolainen at erinaco.ru>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-06-05T11:38:39+02:00

dialog: check CSeq careful with track_cseq_updates

to avoid null pointer access for malformed messages

(cherry picked from commit 59c7bf4f43a8cd5dcb0555835a064d88679956c5)

---

Modified: src/modules/dialog/dlg_cseq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/12ddd127343f1be98a4556aadd9ccfeafc3fbdc7.diff
Patch: https://github.com/kamailio/kamailio/commit/12ddd127343f1be98a4556aadd9ccfeafc3fbdc7.patch

---

diff --git a/src/modules/dialog/dlg_cseq.c b/src/modules/dialog/dlg_cseq.c
index 1e343c9981..b97e8f7123 100644
--- a/src/modules/dialog/dlg_cseq.c
+++ b/src/modules/dialog/dlg_cseq.c
@@ -73,7 +73,8 @@ static int dlg_cseq_prepare_msg(sip_msg_t *msg)
 		return 1;
 	}
 
-	if (parse_headers(msg, HDR_CSEQ_F, 0)==-1) {
+	if((!msg->cseq && (parse_headers(msg,HDR_CSEQ_F,0)<0 || !msg->cseq))
+		|| !msg->cseq->parsed){
 		LM_DBG("parsing cseq header failed\n");
 		return 2;
 	}




More information about the sr-dev mailing list