فهرست منبع

core: check required parameters for execution of onsend_route

- alternative to GH #861
Daniel-Constantin Mierla 8 سال پیش
والد
کامیت
9a1547e881
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      onsend.h

+ 4 - 0
onsend.h

@@ -65,6 +65,10 @@ static inline int run_onsend(struct sip_msg* orig_msg, struct dest_info* dst,
 	snd_flags_t rpl_snd_flags_bak;
 	sr_kemi_eng_t *keng = NULL;
 
+	if(orig_msg==NULL || dst==NULL || buf==NULL) {
+		LM_DBG("required parameters are not available - ignoring\n");
+		return 1;
+	}
 	ret=1;
 	if (onsend_rt.rlist[DEFAULT_RT]){
 		onsnd_info.to=&dst->to;