From 1ca3f1267297b1e3ac45df2e9e240570bff62c84 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 0c234dad9..38c62c811 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -5829,7 +5829,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