瀏覽代碼

- prevent registration of null callbacks function (thanks to Jamey Hicks)

Bogdan-Andrei Iancu 22 年之前
父節點
當前提交
82679e8894
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      modules/tm/t_hooks.c

+ 6 - 0
modules/tm/t_hooks.c

@@ -126,6 +126,12 @@ int register_tmcb( struct sip_msg* p_msg, int types, transaction_cb f,
 			types);
 		return E_BUG;
 	}
+	/* we don't register null functions */
+	if (f==0) {
+		LOG(L_CRIT, "BUG:tm:register_tmcb: null callback function\n");
+		return E_BUG;
+	}
+
 	if (types&TMCB_REQUEST_IN) {
 		if (types!=TMCB_REQUEST_IN) {
 			LOG(L_CRIT, "BUG:tm:register_tmcb: callback type TMCB_REQUEST_IN "