[tracker/binary-log-2: 18/42] libtracker-db: CRC fix



commit 62c8d4918a1c9eb2d603584fd83acdffaffa91b9
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jan 6 11:47:38 2010 +0100

    libtracker-db: CRC fix

 src/libtracker-db/tracker-db-journal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 73493cb..d9f5a2d 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -671,7 +671,7 @@ tracker_db_journal_reader_next (GError **error)
 		entry_size = read_uint32 (reader.current);
 
 		/* Set the bounds for the entry */
-		reader.entry_begin = reader.current + (sizeof (guint32) * 3);
+		reader.entry_begin = reader.current;
 		reader.entry_end = reader.entry_begin + entry_size;
 
 		/* Check the end of the entry does not exceed the end
@@ -709,7 +709,7 @@ tracker_db_journal_reader_next (GError **error)
 		reader.current += 4;
 
 		/* Calculate the crc */
-		crc = tracker_crc32 (reader.entry_begin, entry_size);
+		crc = tracker_crc32 (reader.entry_begin + (sizeof (guint32) * 3), entry_size - (sizeof (guint32) * 3));
 
 		/* Verify checksum */
 		if (crc != crc_check) {



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