Merge pull request #3930 from splucs/fix-s3-walk-prev-dir

Fix panic in the s3 backend walk logic
This commit is contained in:
Milos Gajdos 2023-05-29 16:27:54 +01:00 committed by GitHub
commit 0610484e62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1070,7 +1070,7 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, path, pre
// the most recent skip directory to avoid walking over undesirable files
prevSkipDir string
)
prevDir = prefix + path
prevDir = strings.Replace(path, d.s3Path(""), prefix, 1)
listObjectsInput := &s3.ListObjectsV2Input{
Bucket: aws.String(d.Bucket),