From 31917175720a67cd320fd4eef3e5047ad5304491 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 3 Oct 2024 10:21:05 +0100 Subject: [PATCH] s3: fix crash when using --s3-download-url after migration to SDKv2 Before this change rclone was crashing when the download URL did not supply an X-Amz-Storage-Class header. This change allows the header to be missing. See: https://forum.rclone.org/t/sigsegv-on-ubuntu-24-04/48047 --- backend/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index dac7d6375..636bba0e8 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -5746,7 +5746,7 @@ func (o *Object) downloadFromURL(ctx context.Context, bucketPath string, options ContentEncoding: header("Content-Encoding"), ContentLanguage: header("Content-Language"), ContentType: header("Content-Type"), - StorageClass: types.StorageClass(*header("X-Amz-Storage-Class")), + StorageClass: types.StorageClass(deref(header("X-Amz-Storage-Class"))), } o.setMetaData(&head) return resp.Body, err