aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-11 22:22:49 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-11 22:22:49 -0700
commitbfac55e6c080ec39f83eb9f9e41efb3edfe01545 (patch)
tree4c441ad0d6ec896641f6a150af52b2a2a6139435
parent5516fa8e803640d68c94399a63d29a149ea4fc05 (diff)
downloadseaweedfs-bfac55e6c080ec39f83eb9f9e41efb3edfe01545.tar.xz
seaweedfs-bfac55e6c080ec39f83eb9f9e41efb3edfe01545.zip
avoid integer overflow
fix https://github.com/chrislusf/seaweedfs/issues/2254
-rw-r--r--weed/filer/filer_remote_storage.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filer/filer_remote_storage.go b/weed/filer/filer_remote_storage.go
index f09658015..99ea1d3bb 100644
--- a/weed/filer/filer_remote_storage.go
+++ b/weed/filer/filer_remote_storage.go
@@ -35,7 +35,9 @@ func NewFilerRemoteStorage() (rs *FilerRemoteStorage) {
func (rs *FilerRemoteStorage) LoadRemoteStorageConfigurationsAndMapping(filer *Filer) (err error) {
// execute this on filer
- entries, _, err := filer.ListDirectoryEntries(context.Background(), DirectoryEtcRemote, "", false, math.MaxInt64, "", "", "")
+ limit := int64(math.MaxInt32)
+
+ entries, _, err := filer.ListDirectoryEntries(context.Background(), DirectoryEtcRemote, "", false, limit, "", "", "")
if err != nil {
if err == filer_pb.ErrNotFound {
return nil