Module: sip-router
Branch: master
Commit: d260b2cba84e1699fe9b2c0860de91e018e03bca
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d260b2c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat Jan 29 03:11:46 2011 +0100
core: check for empty port values
- if setport has empty string parameter skip adding ':'
---
action.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/action.c b/action.c
index 9e8344f..268b3f5 100644
--- a/action.c
+++ b/action.c
@@ -991,8 +991,10 @@ int do_action(struct run_act_ctx* h, struct action* a, struct
sip_msg* msg)
tmp=0;
else if (a->type==SET_PORT_T) {
tmp=a->val[0].u.string;
- if (tmp) len = strlen(tmp);
- else len = 0;
+ if (tmp) {
+ len = strlen(tmp);
+ if(len==0) tmp = 0;
+ } else len = 0;
} else {
tmp=uri.port.s;
len = uri.port.len;