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

oracleobjectstorage: fix crash when downloading objects with unknown length - fixes #9694

Nick Craig-Wood862ed2b7ace1
diff --git a/backend/oracleobjectstorage/object.go b/backend/oracleobjectstorage/object.go
index d9cc20f84..74591c56c 100644
--- a/backend/oracleobjectstorage/object.go
+++ b/backend/oracleobjectstorage/object.go
@@ -362,7 +362,11 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadClo
if err != nil {
return nil, err
}
- o.bytes = *bytes
+ if bytes != nil {
+ o.bytes = *bytes
+ } else {
+ fs.Debugf(o, "Failed to find object length")
+ }
return resp.HTTPResponse().Body, nil
}
diff --git a/backend/oracleobjectstorage/oracleobjectstorage.go b/backend/oracleobjectstorage/oracleobjectstorage.go
index 9e27e997f..fca03bbe9 100644
--- a/backend/oracleobjectstorage/oracleobjectstorage.go
+++ b/backend/oracleobjectstorage/oracleobjectstorage.go
@@ -516,7 +516,11 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *objects
o.md5 = md5
}
}
- o.bytes = *info.Size
+ if info.Size != nil {
+ o.bytes = *info.Size
+ } else {
+ fs.Debugf(o, "Failed to find object length")
+ }
o.storageTier = storageTierMap[strings.ToLower(string(info.StorageTier))]
} else {
err := o.readMetaData(ctx) // reads info and headers, returning an error