False positive on "mismatch" enumeration
Finds vulnerabilities in C/C++ source code
Brought to you by:
dwheeler
I have an enumeration that has a value mismatch. Every reference to this value yields an obtuse warning:
[1] (buffer) mismatch:Function does not check the second iterator for over-read conditions (CWE-126). This functino is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it.
I'm guessing the warning is related to std::mismatch() but the whole point of namespace scoping is to disambiguate commonly used names.
class Foo {
public:
enum MatchState {
invalid,
ignored,
exact_match,
near_match,
mismatch,
match_new,
mismatch_new,
};
};