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

Quiet warnings about integer truncation #586

Merged
merged 1 commit into from Mar 3, 2021

Conversation

cbandy
Copy link
Contributor

@cbandy cbandy commented Mar 3, 2021

The TLS config rules have always been int16 while the upstream tls.Config type has always been uint16. The tls version constants are untyped.

LGTM.com (CodeQL) warns

Incorrect conversion of a 64-bit integer from strconv.ParseInt to a lower bit size type int16 without an upper bound check.

Both MinVersion and MaxVersion of crypto/tls.Config are uint16, so the
int16 fields of rules.insecureConfigTLS are too small. GetInt()
interprets integer literals as fitting within 64-bits, so simplify
things by using int64.
@codecov-io
Copy link

Codecov Report

Merging #586 (7bc96fc) into master (bf2cd23) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #586   +/-   ##
=======================================
  Coverage   70.81%   70.81%           
=======================================
  Files           9        9           
  Lines         562      562           
=======================================
  Hits          398      398           
  Misses        143      143           
  Partials       21       21           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf2cd23...7bc96fc. Read the comment docs.

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.

None yet

3 participants