]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Changed strmap's crc32 field to be backwards compatible.
authorTimo Sirainen <tss@iki.fi>
Fri, 5 Feb 2010 22:38:04 +0000 (00:38 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 5 Feb 2010 22:38:04 +0000 (00:38 +0200)
--HG--
branch : HEAD

src/lib-index/mail-index-strmap.c

index af712ac50d6c6cb3a910de99f9a4fd71dbe77a56..abcde3a0dcbddd9265f81aed3ea013f23d612f02 100644 (file)
@@ -742,7 +742,10 @@ mail_index_strmap_view_sync_init(struct mail_index_strmap_view *view,
 
 static inline uint32_t crc32_str_nonzero(const char *str)
 {
-       uint32_t value = crc32_str(str);
+       /* we'll flip the bits because of a bug in our old crc32 code.
+          this keeps the index format backwards compatible with the new fixed
+          crc32 code. */
+       uint32_t value = crc32_str(str) ^ 0xffffffffU;
        return value == 0 ? 1 : value;
 }