Explorar o código

dispatcher(k): safety checks for duri

- due to usage of SR append_branch() instead of km_append_branch(), duri
  has to be checked before giving inner fields as parameters
Daniel-Constantin Mierla %!s(int64=16) %!d(string=hai) anos
pai
achega
1ff6c9a7fb
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      modules_k/dispatcher/dispatch.c

+ 2 - 1
modules_k/dispatcher/dispatch.c

@@ -1061,7 +1061,8 @@ static inline int ds_update_dst(struct sip_msg *msg, str *uri, int mode)
 	}
 	if(ds_append_branch!=0 && route_type==FAILURE_ROUTE)
 	{
-		if (append_branch(msg, 0, 0, duri->s, duri->len, Q_UNSPECIFIED, 0)!=1 )
+		if (append_branch(msg, 0, 0, (duri)?duri->s:0, (duri)?duri->len:0,
+					Q_UNSPECIFIED, 0)!=1 )
 		{
 			LM_ERR("append_branch action failed\n");
 			return -1;