瀏覽代碼

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;