[sr-dev] git:master:5aa2ed26: textops: prevent null dereference on tr_txt_eval_re error

Chris Double chris.double at double.co.nz
Wed Sep 23 14:41:11 CEST 2015


Module: kamailio
Branch: master
Commit: 5aa2ed265f80664f57073213b17c83b1dac42ab4
URL: https://github.com/kamailio/kamailio/commit/5aa2ed265f80664f57073213b17c83b1dac42ab4

Author: Chris Double <chris.double at double.co.nz>
Committer: Chris Double <chris.double at double.co.nz>
Date: 2015-09-23T20:48:56+12:00

textops: prevent null dereference on tr_txt_eval_re error

- Check for NULL pointer before calling subst_expr_free
  to prevent NULL pointer dereference when there is an
  unknown subtype error.

---

Modified: modules/textops/txt_var.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5aa2ed265f80664f57073213b17c83b1dac42ab4.diff
Patch: https://github.com/kamailio/kamailio/commit/5aa2ed265f80664f57073213b17c83b1dac42ab4.patch

---

diff --git a/modules/textops/txt_var.c b/modules/textops/txt_var.c
index 0f704e3..41201f7 100644
--- a/modules/textops/txt_var.c
+++ b/modules/textops/txt_var.c
@@ -124,7 +124,7 @@ int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype,
 	return 0;
 
 error:
-	if (tp->type == TR_PARAM_SPEC) {
+	if (tp->type == TR_PARAM_SPEC && se!=NULL) {
 		subst_expr_free(se);
 	}
 	return -1;




More information about the sr-dev mailing list