mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-05 11:37:44 +01:00
avoid index out of slice range
This commit is contained in:
1 parent
313fd17ae4
commit
12f8251d32
1 file changed
+1
-1
@@ -208,7 +208,7 @@ func (s *SingleChunkCacher) readChunkAt(buf []byte, offset int64) (int, error) {
|
||||
return 0, s.err
|
||||
}
|
||||
|
||||
if len(s.data) == 0 {
|
||||
if len(s.data) <= int(offset) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user