[sr-dev] git:5.2:16b0801b: core: fix a crash in cfg parser related to invalid syntax cases

Henning Westerholt hw at skalatan.de
Thu Mar 5 12:46:04 CET 2020


Module: kamailio
Branch: 5.2
Commit: 16b0801ba6b25a5660f2ba30fef35e9cc81fe9c0
URL: https://github.com/kamailio/kamailio/commit/16b0801ba6b25a5660f2ba30fef35e9cc81fe9c0

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2020-03-05T11:23:40+01:00

core: fix a crash in cfg parser related to invalid syntax cases

(cherry picked from commit 54a0aeee9d30ee85045150d8ad5b75f7a4b71d15)

---

Modified: src/core/cfg.y

---

Diff:  https://github.com/kamailio/kamailio/commit/16b0801ba6b25a5660f2ba30fef35e9cc81fe9c0.diff
Patch: https://github.com/kamailio/kamailio/commit/16b0801ba6b25a5660f2ba30fef35e9cc81fe9c0.patch

---

diff --git a/src/core/cfg.y b/src/core/cfg.y
index 502ca92e0c..b26af8b4a3 100644
--- a/src/core/cfg.y
+++ b/src/core/cfg.y
@@ -2861,7 +2861,7 @@ rval_expr: rval						{ $$=$1;
 		| rval_expr rve_cmpop rval_expr %prec GT { $$=mk_rve2( $2, $1, $3);}
 		| rval_expr rve_equalop rval_expr %prec EQUAL_T {
 			/* comparing with $null => treat as defined or !defined */
-			if($3->op==RVE_RVAL_OP && $3->left.rval.type==RV_PVAR
+			if($3 != NULL && $3->op==RVE_RVAL_OP && $3->left.rval.type==RV_PVAR
 					&& $3->left.rval.v.pvs.type==PVT_NULL) {
 				if($2==RVE_DIFF_OP || $2==RVE_IDIFF_OP
 						|| $2==RVE_STRDIFF_OP) {




More information about the sr-dev mailing list