Kaynağa Gözat

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

Bogdan-Andrei Iancu 22 yıl önce
ebeveyn
işleme
82679e8894
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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);
 			types);
 		return E_BUG;
 		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) {
 		if (types!=TMCB_REQUEST_IN) {
 		if (types!=TMCB_REQUEST_IN) {
 			LOG(L_CRIT, "BUG:tm:register_tmcb: callback type TMCB_REQUEST_IN "
 			LOG(L_CRIT, "BUG:tm:register_tmcb: callback type TMCB_REQUEST_IN "