Open
Description
One of the most common patterns with map and set types is to call find
, check the iterator against end()
, and dereference the iterator. If you forget to perform this check, libc++'s hardening mode doesn't seem to catch this and just returns garbage values.
std::map
: https://godbolt.org/z/TddKM3r1Mset::set
: https://godbolt.org/z/67a61a7n7set::unordered_map
: https://godbolt.org/z/beGesh9j3std::unordered_set
: https://godbolt.org/z/q9q7qrKqj
(CC @danakj)