Explorar o código

core: check required parameters for execution of onsend_route

- alternative to GH #861
Daniel-Constantin Mierla %!s(int64=8) %!d(string=hai) anos
pai
achega
9a1547e881
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;