浏览代码

tm: fix for dialog(k) module workaround

- check if types!=TMCB_MAX if callback registration checks
- TMCB_MAX is used to store pointer to dialog in order to clean it
  quickly
Daniel-Constantin Mierla 16 年之前
父节点
当前提交
0cab381fc9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/tm/t_hooks.c

+ 2 - 2
modules/tm/t_hooks.c

@@ -184,14 +184,14 @@ int register_tmcb( struct sip_msg* p_msg, struct cell *t, int types,
 		return E_BUG;
 	}
 
-	if (types&TMCB_REQUEST_IN) {
+	if ((types!=TMCB_MAX) && (types&TMCB_REQUEST_IN)) {
 		if (types!=TMCB_REQUEST_IN) {
 			LOG(L_CRIT, "BUG:tm:register_tmcb: callback type TMCB_REQUEST_IN "
 				"can't be register along with types\n");
 			return E_BUG;
 		}
 		cb_list = req_in_tmcb_hl;
-	}else if (types & TMCB_LOCAL_REQUEST_IN) {
+	}else if ((types!=TMCB_MAX) && (types & TMCB_LOCAL_REQUEST_IN)) {
 		if (types!=TMCB_LOCAL_REQUEST_IN) {
 			LOG(L_CRIT, "BUG:tm:register_tmcb: callback type"
 					" TMCB_LOCAL_REQUEST_IN can't be register along with"