Skip to content

Commit

Permalink
Fix implicit memory aliasing in for-loop to make gosec happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Oct 29, 2023
1 parent 80dea09 commit 9dee771
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type block struct {
numDataCodewords int
}

var versions = []qrCodeVersion{
var versions = []*qrCodeVersion{
{
1,
Low,
Expand Down Expand Up @@ -2977,7 +2977,7 @@ func chooseQRCodeVersion(level RecoveryLevel, encoder *dataEncoder, numDataBits
numFreeBits := v.numDataBits() - numDataBits

if numFreeBits >= 0 {
chosenVersion = &v
chosenVersion = v
break
}
}
Expand Down Expand Up @@ -3040,7 +3040,7 @@ func (v qrCodeVersion) quietZoneSize() int {
func getQRCodeVersion(level RecoveryLevel, version int) *qrCodeVersion {
for _, v := range versions {
if v.level == level && v.version == version {
return &v
return v
}
}

Expand Down

0 comments on commit 9dee771

Please sign in to comment.