Browse code

core: check for empty port values

- if setport has empty string parameter skip adding ':'

Daniel-Constantin Mierla authored on 29/01/2011 02:11:46
Showing 1 changed files
... ...
@@ -991,8 +991,10 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
991 991
 					tmp=0;
992 992
 				else if (a->type==SET_PORT_T) {
993 993
 					tmp=a->val[0].u.string;
994
-					if (tmp) len = strlen(tmp);
995
-					else len = 0;
994
+					if (tmp) {
995
+						len = strlen(tmp);
996
+						if(len==0) tmp = 0;
997
+					} else len = 0;
996 998
 				} else {
997 999
 					tmp=uri.port.s;
998 1000
 					len = uri.port.len;