Skip to content

Fix CodeQL cpp/integer-multiplication-cast-to-long. - #193

Merged
schmonz merged 1 commit into
masterfrom
schmonz-codeql-multoverflow
Dec 16, 2020
Merged

schmonz merged 1 commit into
masterfrom
schmonz-codeql-multoverflow

Conversation

@schmonz

@schmonz schmonz commented Dec 2, 2020

Copy link
Copy Markdown
Member

(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
Comment thread qmail-send.c Resolved
@schmonz
schmonz force-pushed the schmonz-codeql-multoverflow branch from 22ff2ad to 32fee24 Compare December 3, 2020 20:13
"Multiplication result may overflow 'int' before it is converted to 'long'."

Make n a datetime_sec (synonym for long) to begin with.
@schmonz
schmonz force-pushed the schmonz-codeql-multoverflow branch from 32fee24 to 2c2b634 Compare December 16, 2020 21:47
@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