basho/bitcask

CRC check should be performed before unpacking data

Closed this issue · 3 comments

Currently Bitcask performs a CRC check after unpacking data. This may lead to a badmatch error when unpacking the data if the data is corrupt. Checking the CRC before unpacking the data would avoid this badmatch error.

Relevant section of code:
https://github.com/basho/bitcask/blob/d8958d98d6619a1a8b9e71a7a7b19a7d9fb38ef0/src/bitcask_fileops.erl#L171-181

I've just created pull request with the fix: #32

Dan, this issue looks closable, yes?

yes; this is fixed on master