From 35b2ca642cdfbf8beb8d26b7d00780cb5885c522 Mon Sep 17 00:00:00 2001 From: lluuaapp <266615+lluuaapp@users.noreply.github.com> Date: Mon, 25 Jan 2021 18:00:43 +0100 Subject: [PATCH] b2: fixed possible crash when accessing Backblaze b2 remote --- backend/b2/b2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 75589bfaf..c15b02d93 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -708,7 +708,7 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck remote := file.Name[len(prefix):] // Check for directory isDirectory := remote == "" || strings.HasSuffix(remote, "/") - if isDirectory { + if isDirectory && len(remote) > 1 { remote = remote[:len(remote)-1] } if addBucket {