Explorar o código

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

Daniel-Constantin Mierla %!s(int64=9) %!d(string=hai) anos
pai
achega
ef4d771a25
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/debugger/debugger_json.c

+ 1 - 1
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)
 		{