Module: kamailio
Branch: 5.1
Commit: 5f5f7fd506bbde1ac159cbebf133e499dc06427a
URL: 
https://github.com/kamailio/kamailio/commit/5f5f7fd506bbde1ac159cbebf133e499dc06427a

Author: lyokha <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2018-04-24T14:49:04+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

(cherry picked from commit 38b8fbdf940b273cf541678fd22af7dd4d63ab3d)

---

Modified: src/modules/textops/txt_var.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5f5f7fd506bbde1ac159cbebf133e499dc06427a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5f5f7fd506bbde1ac159cbebf133e499dc06427a.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);
 


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to