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

fix: Incorrect conversion between integer types #2397

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Jan 3, 2024

use strconv.ParseUint instead of strconv.Atoi since Atoi can lead to unexpected errors - if a string is parsed into an int, and that int is converted into another integer type of a smaller size (uint32 in this case), the result can produce unexpected values.

use `strconv.ParseUint` instead of `strconv.Atoi` since
`Atoi` can lead to unexpected errors - if a string is parsed into an int,
and that int is converted into another integer type of a smaller size (uint32 in this case),
the result can produce unexpected values.

Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg arkodg requested a review from a team as a code owner January 3, 2024 21:43
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9bbf170) 64.52% compared to head (ae4e16c) 64.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2397      +/-   ##
==========================================
- Coverage   64.52%   64.50%   -0.02%     
==========================================
  Files         115      115              
  Lines       16833    16833              
==========================================
- Hits        10861    10858       -3     
- Misses       5283     5286       +3     
  Partials      689      689              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arkodg arkodg requested review from a team January 4, 2024 02:37
@zirain zirain merged commit 8a52bbf into envoyproxy:main Jan 4, 2024
17 checks passed
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.

4 participants