Bug
- Added bounds check before call to string::substr to avoid passing a
negative start pos. Test rc.t was broken from commit 0ac9a4b because
it contains 'report.:b' and legacyCheckForDeprecatedVariables was
trying to substr starting from pos 'length() - 12' (-3).
This commit is contained in:
@@ -141,12 +141,14 @@ std::string legacyCheckForDeprecatedVariables ()
|
||||
for (it = context.config.begin (); it != context.config.end (); ++it)
|
||||
{
|
||||
// report.*.limit
|
||||
if (it->first.substr (0, 7) == "report." &&
|
||||
if (it->first.length () > 13 &&
|
||||
it->first.substr (0, 7) == "report." &&
|
||||
it->first.substr (it->first.length () - 6) == ".limit")
|
||||
deprecated.push_back (it->first);
|
||||
|
||||
// report.*.annotaitons
|
||||
if (it->first.substr (0, 7) == "report." &&
|
||||
if (it->first.length () > 19 &&
|
||||
it->first.substr (0, 7) == "report." &&
|
||||
it->first.substr (it->first.length () - 12) == ".annotations")
|
||||
deprecated.push_back (it->first);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user