Skip to content

Commit

Permalink
Merge pull request #3215 from atc0005/i2243-fix-gosec-601-memory-alia…
Browse files Browse the repository at this point in the history
…sing-error

govc: Fix memory aliasing in for loop (gosec G601)
  • Loading branch information
dougm authored Aug 24, 2023
2 parents c63291a + af7833b commit 0695ee6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions govc/vm/snapshot/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func (cmd *tree) Process(ctx context.Context) error {

func (cmd *tree) write(level int, parent string, pref *types.ManagedObjectReference, st []types.VirtualMachineSnapshotTree) {
for _, s := range st {
s := s // avoid implicit memory aliasing

sname := s.Name

if cmd.fullPath && parent != "" {
Expand Down

0 comments on commit 0695ee6

Please sign in to comment.