[sr-dev] git:master:ef4d771a: debugger: re-order loop condition to avoid out of bounds access

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 2 21:04:21 CET 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-11-02T21:04:10+01:00

debugger: re-order loop condition to avoid out of bounds access

---

Modified: modules/debugger/debugger_json.c

---

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

---

diff --git a/modules/debugger/debugger_json.c b/modules/debugger/debugger_json.c
index 3d9150c..2cdadc4 100644
--- a/modules/debugger/debugger_json.c
+++ b/modules/debugger/debugger_json.c
@@ -93,7 +93,7 @@ int _dbg_xavp_dump_lookup(pv_param_t *param)
 
 	xname = (pv_xavp_name_t*)param->pvn.u.dname;
 
-	while(_dbg_xavp_dump[i]!=NULL&&i<DBG_XAVP_DUMP_SIZE)
+	while(i<DBG_XAVP_DUMP_SIZE && _dbg_xavp_dump[i]!=NULL)
 	{
 		if(_dbg_xavp_dump[i]->len==xname->name.len)
 		{




More information about the sr-dev mailing list