Skip to content
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

Add detection of overflow during integer conversion #1130

Open
findmyhappy opened this issue Apr 25, 2024 · 1 comment
Open

Add detection of overflow during integer conversion #1130

findmyhappy opened this issue Apr 25, 2024 · 1 comment

Comments

@findmyhappy
Copy link

Summary

G109 provides detection of overflow during strconv.Atoi, but there seems to be no good way to detect the more common conversions between integers, such as uint32 to int32.

Steps to reproduce the behavior

gosec version

Go version (output of 'go version')

Operating system / Environment

Expected behavior

Actual behavior

@ccojocar ccojocar changed the title Hope to add detection of overflow during integer conversion Add detection of overflow during integer conversion May 2, 2024
@ccojocar
Copy link
Member

ccojocar commented May 2, 2024

This is a good addition. I was also thinking about a rule to detect this conversions which can lead to overflows.

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

No branches or pull requests

2 participants