Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

local: fix crash on Stat error while reading a file

Nick Craig-Wood7d4da1c66ad4
diff --git a/backend/local/local.go b/backend/local/local.go
index b810a5078..11765cdb1 100644
--- a/backend/local/local.go
+++ b/backend/local/local.go
@@ -671,6 +671,9 @@ type localOpenFile struct {
func (file *localOpenFile) Read(p []byte) (n int, err error) {
// Check if file has the same size and modTime
fi, err := file.fd.Stat()
+ if err != nil {
+ return 0, errors.Wrap(err, "can't read status of source file while transferring")
+ }
if file.o.size != fi.Size() || file.o.modTime != fi.ModTime() {
return 0, errors.New("can't copy - source file is being updated")
}