Module: kamailio Branch: master Commit: 5aa2ed265f80664f57073213b17c83b1dac42ab4 URL: https://github.com/kamailio/kamailio/commit/5aa2ed265f80664f57073213b17c83b1...
Author: Chris Double chris.double@double.co.nz Committer: Chris Double chris.double@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/5aa2ed265f80664f57073213b17c83b1... Patch: https://github.com/kamailio/kamailio/commit/5aa2ed265f80664f57073213b17c83b1...
---
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;