mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-05 03:27:42 +01:00
prevent reading wrong data
fix https://github.com/seaweedfs/seaweedfs/issues/6565
This commit is contained in:
1 parent
60c9a7496d
commit
299e372b48
1 file changed
+3
@@ -56,6 +56,9 @@ func (group *ChunkGroup) ReadDataAt(fileSize int64, buff []byte, offset int64) (
|
||||
for si := sectionIndexStart; si < sectionIndexStop+1; si++ {
|
||||
section, found := group.sections[si]
|
||||
rangeStart, rangeStop := max(offset, int64(si*SectionSize)), min(offset+int64(len(buff)), int64((si+1)*SectionSize))
|
||||
if rangeStart >= rangeStop {
|
||||
continue
|
||||
}
|
||||
if !found {
|
||||
rangeStop = min(rangeStop, fileSize)
|
||||
for i := rangeStart; i < rangeStop; i++ {
|
||||
|
||||
Reference in new issue
Block a user