浏览代码

dialog: safety check for handling http replies in cseq update code

- reported by GH #1277
Daniel-Constantin Mierla 8 年之前
父节点
当前提交
ba7f663a0f
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      src/modules/dialog/dlg_cseq.c

+ 7 - 3
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;
 	}