Skip to content

Conversation

@lucaderi
Copy link
Member

Fixes https://github.com/ntop/nDPI/security/code-scanning/7

To fix the problem, we need to ensure that the multiplication is performed using the larger integer type (u_int64_t) to avoid overflow. This can be achieved by casting one of the operands to u_int64_t before performing the multiplication. Specifically, we can cast i to u_int64_t before multiplying it with the result of rand().

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ger type

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@lucaderi lucaderi marked this pull request as ready for review January 13, 2025 19:13
@sonarqubecloud
Copy link

@lucaderi lucaderi merged commit 6b686be into dev Jan 13, 2025
37 checks passed
@IvanNardi IvanNardi deleted the alert-autofix-7 branch February 13, 2025 12:27
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.

2 participants