aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-11-25 07:29:31 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-11-29 12:57:44 -0500
commit7b544c16beaa1f6ec70a72d53fe84cae95f70a41 (patch)
treee6348059fd6dfd8cf66a93c1a3b1d72078352016
parent2aad06b056054442964f46752bdb098030cdb866 (diff)
bugfix: fix out-of-bound array access in cedf_activate_plugin()
Make sure to check for maximum index value when accessing cedf_domain_t array in cedf_activate_plugin(). Reported-by: Jeremy Erickson <jerickso@cs.unc.edu>
-rw-r--r--litmus/sched_cedf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index 111e4fb1c62b..8c9513d33f59 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -708,7 +708,8 @@ static long cedf_activate_plugin(void)
708 if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) 708 if (cpumask_test_cpu(cpu, cedf[j].cpu_map))
709 break; 709 break;
710 /* if it is in a cluster go to next cpu */ 710 /* if it is in a cluster go to next cpu */
711 if (cpumask_test_cpu(cpu, cedf[j].cpu_map)) 711 if (j < num_clusters &&
712 cpumask_test_cpu(cpu, cedf[j].cpu_map))
712 continue; 713 continue;
713 714
714 /* this cpu isn't in any cluster */ 715 /* this cpu isn't in any cluster */