Open abd-770 opened 2 months ago
/assign @czs007 /unassign
@abd-770 could you help on some examples of the fix? it could be even better if you can fix that
Sure, I will do the changes.
This is one of the line throwing the vulnerability.
https://github.com/milvus-io/milvus/blob/ea36d13ab0b55bda1f14cb0a9c7dee255e368f19/internal/core/src/segcore/IndexConfigGenerator.cpp#L74
This can be fixed by using static_cast rather than c-styles explicit casting.
return std::max(static_cast<int64_t>(max_index_row_count_ * ratio),
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen
.
Is there an existing issue for this?
Environment
Current Behavior
Static Scan reported Functional-notation casting vulnerability on 200+ lines.
The current implementation uses C-style casts instead of C++ style casts (static_cast, reinterpret_cast, const_cast). C-style casting is less safe and can lead to undefined behavior and reduced code readability. C++ provides specific casting operators that are safer, clearer, and convey the intent of the cast more explicitly.
Could you please clarify why C-style casts were chosen over C++ style casts in this implementation? Understanding the reasoning behind this decision will help in assessing whether we should provide the changes needed to solve this vulnerability
Expected Behavior
No response
Steps To Reproduce
No response
Milvus Log
No response
Anything else?
No response