codec_index: check sizes, new tests for data corruption & refactor (#84)

* bitcask/codec_index: check key and data sizes

* codec_index: tests for key and data size overflows

* codec_index: simplify internal funcs for unused returns
This commit is contained in:
Ignacio Hagopian
2019-09-03 23:26:26 -03:00
committed by James Mills
parent 24ab3fbf27
commit 93cc1d409f
3 changed files with 86 additions and 40 deletions

View File

@@ -351,7 +351,7 @@ func (b *Bitcask) reopen() error {
}
defer f.Close()
if err := internal.ReadIndex(f, t); err != nil {
if err := internal.ReadIndex(f, t, b.config.maxKeySize, b.config.maxValueSize); err != nil {
return err
}
} else {