diff --git a/src/blockstore/ondisk_formats.h b/src/blockstore/ondisk_formats.h index 071e9b8d..6faa950a 100644 --- a/src/blockstore/ondisk_formats.h +++ b/src/blockstore/ondisk_formats.h @@ -141,7 +141,7 @@ struct __attribute__((__packed__)) journal_entry inline uint32_t je_crc32(journal_entry *je) { // 0x48674bc7 = crc32(4 zero bytes) - return crc32c(0x48674bc7, ((uint8_t*)je)+4, je->size-4); + return je->size < 4 ? 0 : crc32c(0x48674bc7, ((uint8_t*)je)+4, je->size-4); } // "VITAstor"