1
0
mirror of https://github.com/taigrr/bitcask synced 2025-01-18 04:03:17 -08:00

Fix a bug when MaxValueSize == 0 on Merge operations

This commit is contained in:
2020-12-18 07:35:16 +10:00
parent 29e1cf648b
commit 8a60b5a370
5 changed files with 18 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ func readKeyBytes(r io.Reader, maxKeySize uint32) ([]byte, error) {
return nil, errors.Wrap(errTruncatedKeySize, err.Error())
}
size := binary.BigEndian.Uint32(s)
if size > uint32(maxKeySize) {
if maxKeySize > 0 && size > uint32(maxKeySize) {
return nil, errKeySizeTooLarge
}