[sr-dev] git:master:56f86535: phonenum: proper access to the str type param resid

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 3 20:03:55 CEST 2019


Module: kamailio
Branch: master
Commit: 56f86535e0ae3fcf8fa2d0b565c7ab61351678d0
URL: https://github.com/kamailio/kamailio/commit/56f86535e0ae3fcf8fa2d0b565c7ab61351678d0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-09-03T20:03:05+02:00

phonenum: proper access to the str type param resid

---

Modified: src/modules/phonenum/phonenum_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/56f86535e0ae3fcf8fa2d0b565c7ab61351678d0.diff
Patch: https://github.com/kamailio/kamailio/commit/56f86535e0ae3fcf8fa2d0b565c7ab61351678d0.patch

---

diff --git a/src/modules/phonenum/phonenum_mod.c b/src/modules/phonenum/phonenum_mod.c
index 6c9e0b1d1b..ea49e73a86 100644
--- a/src/modules/phonenum/phonenum_mod.c
+++ b/src/modules/phonenum/phonenum_mod.c
@@ -112,8 +112,7 @@ static int phonenum_resid_param(modparam_t type, void* val)
 {
 	str rname;
 
-	rname.s = (char*)val;
-	rname.len = strlen(rname.s);
+	rname = *((str*)val);
 	if(sr_phonenum_add_resid(&rname) < 0) {
 		LM_ERR("failed to register result container with id: %.*s\n",
 				rname.len, rname.s);




More information about the sr-dev mailing list