summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2023-08-23 20:47:54 -0600
committerGitHub <noreply@github.com>2023-08-23 20:47:54 -0600
commitb377208ededa964893dedd5660734e9616f998f7 (patch)
tree977e8b5621c910e0f369936a77894bece48f3270 /modules/caddytls
parent4776f62caa36c580d24be8e55ebc6a61ae129f51 (diff)
chore: Appease gosec linter (#5777)
These happen to be harmless memory aliasing but I guess the linter can't know that and we can't really prove it in general.
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/certselection.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/caddytls/certselection.go b/modules/caddytls/certselection.go
index 0311f11..1bef890 100644
--- a/modules/caddytls/certselection.go
+++ b/modules/caddytls/certselection.go
@@ -58,7 +58,8 @@ nextChoice:
if len(p.SerialNumber) > 0 {
var found bool
for _, sn := range p.SerialNumber {
- if cert.Leaf.SerialNumber.Cmp(&sn.Int) == 0 {
+ snInt := sn.Int // avoid taking address of iteration variable (gosec warning)
+ if cert.Leaf.SerialNumber.Cmp(&snInt) == 0 {
found = true
break
}