Browse code

core: test the limits of nested select level before accessing array value

Daniel-Constantin Mierla authored on 30/01/2014 11:14:48
Showing 1 changed files
... ...
@@ -432,7 +432,7 @@ int run_select(str* res, select_t* s, struct sip_msg* msg)
432 432
 	orig_level = select_level;
433 433
 	ret = 0;
434 434
 	for (	select_level=0;
435
-		(ret == 0) && (s->f[select_level] !=0 ) && (select_level<MAX_NESTED_CALLS);
435
+		(ret == 0) && (select_level<MAX_NESTED_CALLS) && (s->f[select_level] !=0 );
436 436
 		select_level++
437 437
 	) {
438 438
 		ret = s->f[select_level](res, s, msg);