[tracker/tracker-0.6] Fixes binary search index size error, assumed 0 to array->len



commit 908c69ac4cb8c4c2df8ffd70e49682ebbc67a5d6
Author: Martyn Russell <martyn imendio com>
Date:   Wed May 6 12:13:36 2009 +0100

    Fixes binary search index size error, assumed 0 to array->len
    
    This should have been 0 to array->len - 1. This was causing READ
    errors noticed on the device as a crash finally.
---
 src/libtracker-db/tracker-db-index.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/libtracker-db/tracker-db-index.c b/src/libtracker-db/tracker-db-index.c
index 353c3f5..06051b7 100644
--- a/src/libtracker-db/tracker-db-index.c
+++ b/src/libtracker-db/tracker-db-index.c
@@ -1270,7 +1270,7 @@ tracker_db_index_add_word (TrackerDBIndex *indez,
 
 	/* It is not the first time we find the word, perform binary search */
 	left = 0;
-	right = array->len;
+	right = array->len - 1;
 	center = (right - left) / 2;
 
 	do {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]