fix possible out of range bytes

avoid buff out of range resp.Data = buff[:totalRead]
This commit is contained in:
Chris Lu
2020-08-16 23:47:34 -07:00
parent 48ed7f8a32
commit 2ac27616bc
3 changed files with 8 additions and 20 deletions

View File

@@ -172,7 +172,7 @@ func min(x, y int64) int64 {
return y
}
func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (offset int64, size int) {
func (pages *ContinuousDirtyPages) ReadDirtyData(data []byte, startOffset int64) (maxStop int64) {
pages.lock.Lock()
defer pages.lock.Unlock()