[sr-dev] git:master:38b8fbdf: textops: reinitialize new tr_param_t object for tr_txt_parse_re()

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 24 14:48:05 CEST 2018


Module: kamailio
Branch: master
Commit: 38b8fbdf940b273cf541678fd22af7dd4d63ab3d
URL: https://github.com/kamailio/kamailio/commit/38b8fbdf940b273cf541678fd22af7dd4d63ab3d

Author: lyokha <alexey.radkov at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-04-24T14:46:32+02:00

textops: reinitialize new tr_param_t object for tr_txt_parse_re()

- avoid segfault when running fparam_free_restore() on
  such an object immediately after creation, because its field "next"
  contains garbage

---

Modified: src/modules/textops/txt_var.c

---

Diff:  https://github.com/kamailio/kamailio/commit/38b8fbdf940b273cf541678fd22af7dd4d63ab3d.diff
Patch: https://github.com/kamailio/kamailio/commit/38b8fbdf940b273cf541678fd22af7dd4d63ab3d.patch

---

diff --git a/src/modules/textops/txt_var.c b/src/modules/textops/txt_var.c
index 398cd42120..6970b66bc7 100644
--- a/src/modules/textops/txt_var.c
+++ b/src/modules/textops/txt_var.c
@@ -215,6 +215,7 @@ char* tr_txt_parse_re(str *in, trans_t *t)
 				LM_ERR("no more private memory!\n");
 				goto error;
 			}
+			memset(tp, 0, sizeof(tr_param_t));
 
 			se=subst_parser(&tok);
 




More information about the sr-dev mailing list