Skip to content

gosec: fix G601 rule #2522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2023
Merged

gosec: fix G601 rule #2522

merged 1 commit into from
Aug 18, 2023

Conversation

AlexanderYastrebov
Copy link
Member

gosec started to produce false positives
"G601 (CWE-118): Implicit memory aliasing in for loop." for slices of struct pointers, see securego/gosec#966

This changes fixes G601 rule wwarnings instead of muting it.

gosec started to produce false positives
"G601 (CWE-118): Implicit memory aliasing in for loop."
for slices of struct pointers, see securego/gosec#966

This changes fixes G601 rule wwarnings instead of muting it.

Signed-off-by: Alexander Yastrebov <[email protected]>
@RomanZavodskikh
Copy link
Contributor

Can we somehow make gosec (and CI tests) fail in case somebody will violate this recommendation again? At the moment it seems that G601 is still a warning that could be easily ignored.

@AlexanderYastrebov
Copy link
Member Author

@RomanZavodskikh make gosec fails properly so its ok.

@szuecs
Copy link
Member

szuecs commented Aug 18, 2023

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit 65016ea into master Aug 18, 2023
@AlexanderYastrebov AlexanderYastrebov deleted the gosec/fix-G601 branch August 18, 2023 12:34
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.

3 participants