From 12f8251d3275866efac02bbbe0a82134df6b4898 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 14 Jan 2023 13:31:22 -0800 Subject: [PATCH] avoid index out of slice range --- weed/filer/reader_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filer/reader_cache.go b/weed/filer/reader_cache.go index 0a7c83de7..1918cacf8 100644 --- a/weed/filer/reader_cache.go +++ b/weed/filer/reader_cache.go @@ -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 }