Browse code

core: keep the password only if the user part is set

- a report by Timo Klecker

Daniel-Constantin Mierla authored on 05/12/2014 17:17:39
Showing 1 changed files
... ...
@@ -932,8 +932,8 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
932 932
 
933 933
 				if (a->type==SET_USERPASS_T) tmp=0;
934 934
 				else tmp=uri.passwd.s;
935
-				/* passwd */
936
-				if (tmp){
935
+				/* passwd - keep it only if user is set */
936
+				if (user && tmp){
937 937
 					len=uri.passwd.len; if(crt+len+1>end) goto error_uri;
938 938
 					*crt=':'; crt++;
939 939
 					memcpy(crt,tmp,len);crt+=len;