mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-02 03:37:19 +02:00
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:
parent
507ee20f3b
commit
9951da5710
1 changed files with 4 additions and 2 deletions
|
@ -141,12 +141,14 @@ std::string legacyCheckForDeprecatedVariables ()
|
||||||
for (it = context.config.begin (); it != context.config.end (); ++it)
|
for (it = context.config.begin (); it != context.config.end (); ++it)
|
||||||
{
|
{
|
||||||
// report.*.limit
|
// 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")
|
it->first.substr (it->first.length () - 6) == ".limit")
|
||||||
deprecated.push_back (it->first);
|
deprecated.push_back (it->first);
|
||||||
|
|
||||||
// report.*.annotaitons
|
// 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")
|
it->first.substr (it->first.length () - 12) == ".annotations")
|
||||||
deprecated.push_back (it->first);
|
deprecated.push_back (it->first);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue