Skip to content

Conversation

@michaelbeale-IL
Copy link

Potential fix for https://github.com/IntelLabs/HEC-openfhe-development-test/security/code-scanning/665

The best way to fix this issue is to remove the always-false condition and the associated exception. The line if (logc < 0) { OPENFHE_THROW("Too small scaling factor"); } can simply be deleted, as logc can never be negative. No additional error checking is required, since a scaling factor that really is "too small" (i.e., all values are zero) simply results in logc==0, which is handled safely by the rest of the code. The logic and functionality remain unchanged for all valid and invalid inputs, except that the dead code is eliminated.

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

…lways the same

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

1 participant