File: 0001-Fix-misalignment-of-struct-member.patch

package info (click to toggle)
golang-github-aws-aws-sdk-go-v2 1.24.1-2~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 554,032 kB
  • sloc: java: 15,941; makefile: 419; sh: 175
file content (31 lines) | stat: -rw-r--r-- 1,153 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Daniel Swarbrick <dswarbrick@debian.org>
Date: Mon, 26 Feb 2024 19:45:40 +0100
Subject: Fix misalignment of struct member

Bug: https://github.com/aws/aws-sdk-go-v2/issues/2518

Misaligned struct member `size` will cause a panic to occur on 32-bit
arch, since it is used in atomic operations.
---
 service/internal/endpoint-discovery/cache.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/service/internal/endpoint-discovery/cache.go b/service/internal/endpoint-discovery/cache.go
index 14ee172..1ca6332 100644
--- a/service/internal/endpoint-discovery/cache.go
+++ b/service/internal/endpoint-discovery/cache.go
@@ -9,12 +9,12 @@ import (
 // based on some key. The data structure makes use of a read write
 // mutex to enable asynchronous use.
 type EndpointCache struct {
-	endpoints     sync.Map
-	endpointLimit int64
 	// size is used to count the number elements in the cache.
 	// The atomic package is used to ensure this size is accurate when
 	// using multiple goroutines.
 	size int64
+	endpoints     sync.Map
+	endpointLimit int64
 }
 
 // NewEndpointCache will return a newly initialized cache with a limit