Module: kamailio
Branch: 5.1
Commit: 12ddd127343f1be98a4556aadd9ccfeafc3fbdc7
URL:
https://github.com/kamailio/kamailio/commit/12ddd127343f1be98a4556aadd9ccfe…
Author: Dmitri Savolainen <savolainen(a)erinaco.ru>
Committer: Daniel-Constantin Mierla <miconda(a)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/12ddd127343f1be98a4556aadd9ccfe…
Patch:
https://github.com/kamailio/kamailio/commit/12ddd127343f1be98a4556aadd9ccfe…
---
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;
}