From 9057fee6266187e871edd0f42fe97a5393ad7571 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 7 May 2009 15:50:55 +0000 Subject: [PATCH] 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 --- src/apps/debuganalyzer/model/ThreadModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/debuganalyzer/model/ThreadModel.cpp b/src/apps/debuganalyzer/model/ThreadModel.cpp index f8517b2a3e..28eb3af122 100644 --- a/src/apps/debuganalyzer/model/ThreadModel.cpp +++ b/src/apps/debuganalyzer/model/ThreadModel.cpp @@ -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;