cppcheck/cve-test-suite/cve-2018-1000618.cpp

17 lines
374 B
C++

// Reduced source code. Inspired by this fix:
// https://github.com/EOSIO/eos/pull/4112/commits/ef62761c5e388880e8bb1bb41e8b512a5187f255
#include <set>
class C
{
std::set<int> typedefs;
bool is_type(int type) const
{
if (typedefs.find(type) != typedefs.end())
return is_type(type); // BUG: endless recursion
return false;
}
};