Module: kamailio
Branch: master
Commit: ba7f663a0f1da799fc7a8be9b86039af2862f287
URL:
https://github.com/kamailio/kamailio/commit/ba7f663a0f1da799fc7a8be9b86039a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-10-25T10:17:12+02:00
dialog: safety check for handling http replies in cseq update code
- reported by GH #1277
---
Modified: src/modules/dialog/dlg_cseq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ba7f663a0f1da799fc7a8be9b86039a…
Patch:
https://github.com/kamailio/kamailio/commit/ba7f663a0f1da799fc7a8be9b86039a…
---
diff --git a/src/modules/dialog/dlg_cseq.c b/src/modules/dialog/dlg_cseq.c
index f1b047d210..1e343c9981 100644
--- a/src/modules/dialog/dlg_cseq.c
+++ b/src/modules/dialog/dlg_cseq.c
@@ -59,12 +59,16 @@ static int dlg_cseq_prepare_msg(sip_msg_t *msg)
LM_DBG("prepare msg for cseq update operations\n");
if(msg->first_line.type==SIP_REQUEST) {
- if(!IS_SIP(msg))
- {
+ if(!IS_SIP(msg)) {
LM_DBG("non sip request message\n");
return 1;
}
- } else if(msg->first_line.type!=SIP_REPLY) {
+ } else if(msg->first_line.type==SIP_REPLY) {
+ if(!IS_SIP_REPLY(msg)) {
+ LM_DBG("non sip reply message\n");
+ return 1;
+ }
+ } else {
LM_DBG("non sip message\n");
return 1;
}