[SR-Dev] git:master: core: bug fix in PV printing related to static buffer

Henning Westerholt henning.westerholt at 1und1.de
Mon May 18 19:32:35 CEST 2009


Module: sip-router
Branch: master
Commit: 103ffecf7e6a7bf84da10a3917e3df81b6964e4b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=103ffecf7e6a7bf84da10a3917e3df81b6964e4b

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Mon May 18 19:29:30 2009 +0200

core: bug fix in PV printing related to static buffer

fix a bug in the PV printing (for k). The code allocated a static buffer, but
failed to proper initialize it with zero. Thus in certain cases old data from
previous PV evaluation is returned.
is returned

---

 sr_module.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sr_module.c b/sr_module.c
index a3e51e6..1ab8868 100644
--- a/sr_module.c
+++ b/sr_module.c
@@ -1360,6 +1360,7 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
 	avp_t* avp;
 	pv_value_t pv_val;
 	static char pve_buf[256]; /* ugly hack needed for PVE */
+	memset(pve_buf, 0, sizeof(pve_buf));
 	
 	switch(param->type) {
 		case FPARAM_REGEX:




More information about the sr-dev mailing list