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.
This commit is contained in:
Matt Holt
2023-08-23 20:47:54 -06:00
committed by GitHub
parent 4776f62caa
commit b377208ede
2 changed files with 4 additions and 2 deletions

View File

@@ -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
}