Module: kamailio
Branch: master
Commit: 59c7bf4f43a8cd5dcb0555835a064d88679956c5
URL:
https://github.com/kamailio/kamailio/commit/59c7bf4f43a8cd5dcb0555835a064d8…
Author: Dmitri Savolainen <savolainen(a)erinaco.ru>
Committer: Dmitri Savolainen <savolainen(a)erinaco.ru>
Date: 2018-06-01T10:38:40+03:00
dialog: check CSeq careful with track_cseq_updates
to avoid null pointer access for malformed messages
---
Modified: src/modules/dialog/dlg_cseq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/59c7bf4f43a8cd5dcb0555835a064d8…
Patch:
https://github.com/kamailio/kamailio/commit/59c7bf4f43a8cd5dcb0555835a064d8…
---
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;
}