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 CodeQL cpp/integer-multiplication-cast-to-long. #193

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

schmonz
Copy link
Member

@schmonz schmonz commented Dec 2, 2020

(Seen under the project's "code scanning alerts".)

"Multiplication result may overflow 'int' before it is converted to 'long'."

Recommendation: "Use a cast to ensure that the multiplication is done
using the larger integer type to avoid overflow."

@schmonz schmonz added the bug Something isn't working label Dec 2, 2020
@schmonz schmonz added this to the 1.09 milestone Dec 2, 2020
qmail-send.c Outdated Show resolved Hide resolved
"Multiplication result may overflow 'int' before it is converted to 'long'."

Make n a datetime_sec (synonym for long) to begin with.
@schmonz schmonz merged commit 3d10c87 into master Dec 16, 2020
@schmonz schmonz deleted the schmonz-codeql-multoverflow branch December 16, 2020 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants