Fixed cause of potential crash. The binary search could have found the count as

final index and accessed the non-existing item.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-05-07 15:50:55 +00:00
parent 2b829b045f
commit 9057fee626

View File

@ -101,7 +101,7 @@ ThreadModel::FindSchedulingEvent(bigtime_t time)
time += fModel->BaseTime();
int32 lower = 0;
int32 upper = CountSchedulingEvents();
int32 upper = CountSchedulingEvents() - 1;
while (lower < upper) {
int32 mid = (lower + upper) / 2;