Details
-
Task
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
Service Arch
Description
Recently I had a patch where I converted a std::pair<int, vector> to a struct to improve readability:
struct MyStruct {
|
int errCode; |
std::vector items;
|
};
|
This change introduced the bug that while std::pair initializes the values to defaults (so the int gets initialized to 0), the struct doesn't do this, meaning that there might be a garbage value in the errCode field.
Can we add a clang-tidy rule to cover this case? Or does Coverity already cover it? See the comments for more info; it seems a memory sanitizer may or may not catch this bug.
Attachments
Issue Links
- is related to
-
SERVER-20588 Enable MemorySanitizer
-
- Backlog
-