Module: sip-router
Branch: master
Commit: d5fbc4ead58c7ef47aba91238c74f40f9162f78d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d5fbc4e…
Author: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Date: Tue Apr 3 13:10:37 2012 +0200
modules_k/siptrace: Fixed \0 termination for tmp_pipport.
Thanks Michal Karas for the patch.
---
modules_k/siptrace/siptrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
index b54d893..eb893a3 100644
--- a/modules_k/siptrace/siptrace.c
+++ b/modules_k/siptrace/siptrace.c
@@ -1694,13 +1694,13 @@ static int pipport2su (char *pipport, union sockaddr_union
*tmp_su, unsigned int
return -1;
}
- if((len = strlen(pipport)) > 256) {
+ if((len = strlen(pipport)) >= 256) {
LM_ERR("too big pipport\n");
goto error;
}
/* our tmp string */
- strncpy(tmp_piport, pipport, len);
+ strncpy(tmp_piport, pipport, len+1);
len = 0;