Skip to content

Conversation

@Aflynn50
Copy link
Contributor

Running gosec on the SQLair codebase uncovered a potential issue with the memory location of a loop variable being aliased mid loop. This can be an issue in go versions <1.22 as the memory location of the loop variable is reused in subsequent iterations, meaning the value may change unexpectedly.

Original issue:

$ gosec ./...
[/home/aflynn/Canonical/SQLair/sqlair/internal/expr/bindtypes.go:212] - G601 (CWE-118): Implicit memory aliasing in for loop. (Confidence: MEDIUM, Severity: MEDIUM)
    211: 				}
  > 212: 				remainingMap = &source.typeName
    213: 				continue

Running gosec on the SQLair codebase uncovered a potential issue with
the memory location of a loop variable being aliased mid loop. This can
be an issue in go versions <1.22 as the memory location of the loop
variable is reused in subsequent iterations, meaning the value may
change unexpectedly.
@Aflynn50
Copy link
Contributor Author

Closing this as it is fixed by the update to Go 1.24 #182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant