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 possible integer overflow in multiplication #3368

Merged
merged 1 commit into from Jan 14, 2022

Conversation

EnricoMi
Copy link
Collaborator

@EnricoMi EnricoMi commented Jan 14, 2022

CodeQL identified a few integer multiplications that might overflow before cast to a larger type:

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

This rule finds code that converts the result of an integer multiplication to a larger type.
Since the conversion applies after the multiplication, arithmetic overflow may still occur.

See CWE-190 CWE-192 CWE-197 CWE-681.

Fixes:
https://github.com/horovod/horovod/security/code-scanning/3
https://github.com/horovod/horovod/security/code-scanning/4
https://github.com/horovod/horovod/security/code-scanning/5
https://github.com/horovod/horovod/security/code-scanning/6
https://github.com/horovod/horovod/security/code-scanning/7
https://github.com/horovod/horovod/security/code-scanning/8

See: https://github.com/horovod/horovod/runs/4816240959

Signed-off-by: Enrico Minack <github@enrico.minack.dev>
@github-actions
Copy link

Unit Test Results

     802 files  ±0       802 suites  ±0   8h 58m 39s ⏱️ + 13m 10s
     717 tests ±0       672 ✔️ ±0       45 💤 ±0  0 ±0 
17 324 runs  ±0  12 238 ✔️ ±0  5 086 💤 ±0  0 ±0 

Results for commit 3f91c86. ± Comparison against base commit 0b1a4a6.

@github-actions
Copy link

Unit Test Results (with flaky tests)

     890 files   -   56       890 suites   - 56   9h 25m 26s ⏱️ - 10m 51s
     717 tests ±    0       671 ✔️ +    3       45 💤 ±    0  1  - 3 
19 430 runs   - 938  13 551 ✔️  - 672  5 878 💤  - 263  1  - 3 

For more details on these failures, see this check.

Results for commit 3f91c86. ± Comparison against base commit 0b1a4a6.

@EnricoMi EnricoMi merged commit 31bba3b into master Jan 14, 2022
@EnricoMi EnricoMi deleted the branch-fix-multiplication-types branch January 14, 2022 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants