gosec: G601 - Implicit memory aliasing in for loop

G601 warning doen't mean there's a vulnerabilty. But this code could
have unintended bugs. Disabling warnings locally.
This commit is contained in:
Juan Abia 2021-12-04 14:08:00 +01:00 committed by Alexander Todorov
parent 8136209d17
commit 610db6563a
7 changed files with 24 additions and 0 deletions

View file

@ -202,6 +202,8 @@ func (a *AWS) Register(name, bucket, key string, shareWith []string, rpmArch str
log.Printf("[AWS] 🎥 Sharing ec2 snapshot")
var userIds []*string
for _, v := range shareWith {
// Implicit memory alasing doesn't couse any bug in this case
/* #nosec G601 */
userIds = append(userIds, &v)
}
_, err := a.ec2.ModifySnapshotAttribute(
@ -281,6 +283,8 @@ func (a *AWS) Register(name, bucket, key string, shareWith []string, rpmArch str
var launchPerms []*ec2.LaunchPermission
for _, id := range shareWith {
launchPerms = append(launchPerms, &ec2.LaunchPermission{
// Implicit memory alasing doesn't couse any bug in this case
/* #nosec G601 */
UserId: &id,
})
}