From: Timo Sirainen Date: Fri, 5 Feb 2010 22:38:04 +0000 (+0200) Subject: lib-index: Changed strmap's crc32 field to be backwards compatible. X-Git-Tag: 2.0.beta3~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77463499e3a97a9b386e27fb1e6409263726ef5b;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Changed strmap's crc32 field to be backwards compatible. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-strmap.c b/src/lib-index/mail-index-strmap.c index af712ac50d..abcde3a0dc 100644 --- a/src/lib-index/mail-index-strmap.c +++ b/src/lib-index/mail-index-strmap.c @@ -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; }