Commit 1bb10705 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

Do not try to memmove() past array boundaries when removing an element.

2009-03-27  Carlos Garnacho  <carlos@imendio.com>

        * src/libtracker-db/tracker-db-index.c (indexer_update_word): Do not
        try to memmove() past array boundaries when removing an element.

svn path=/trunk/; revision=3144
parent cef1dca6
2009-03-27 Carlos Garnacho <carlos@imendio.com>
* src/libtracker-db/tracker-db-index.c (indexer_update_word): Do not
try to memmove() past array boundaries when removing an element.
2009-03-27 Carlos Garnacho <carlos@imendio.com>
* src/libtracker-data/tracker-data-query.c (result_set_to_metadata):
......
......@@ -700,7 +700,7 @@ indexer_update_word (const gchar *word,
if (score < 1) {
/* Shift all subsequent records in array down one place */
g_memmove (&previous_hits[center], &previous_hits[center + 1],
(old_hit_count - center) * sizeof (TrackerDBIndexItem));
(old_hit_count - center - 1) * sizeof (TrackerDBIndexItem));
old_hit_count--;
} else {
guint32 service_type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment