Module: sip-router
Branch: master
Commit: 3691d7b9a1142eaeba2521fe01d3c1c6e9ceef2b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3691d7b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Apr 20 17:45:25 2010 +0200
pv: use local buffer to return empty val after s.strip
- further assignments may want to ensure it is zero-terminated and cause
crash
- reported by Juha Heinanen
---
modules_k/pv/pv_trans.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c
index 9ddd125..dbe2ab7 100644
--- a/modules_k/pv/pv_trans.c
+++ b/modules_k/pv/pv_trans.c
@@ -442,7 +442,8 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype,
break;
if(i>=val->rs.len)
{
- val->rs.s = "";
+ _tr_buffer[0] = '\0';
+ val->rs.s = _tr_buffer;
val->rs.len = 0;
break;
}