[tracker/binary-log-2: 13/38] libtracker-db: CRC fix



commit 3ffb9e4215f5b6894174b5b43b8d064da01bdff6
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 08a7c59..dcd67d3 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -673,7 +673,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
@@ -711,7 +711,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]