mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
DOM: Prevent use-after-free in CLI2::canonicalize
This commit is contained in:
parent
5523c2cbf0
commit
e478396a04
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
|||
auto size = elements.size ();
|
||||
|
||||
std::string canonical;
|
||||
if (context.cli2.canonicalize (canonical, "attribute", elements[0]))
|
||||
if ((size == 1 || size == 2) && context.cli2.canonicalize (canonical, "attribute", elements[0]))
|
||||
{
|
||||
// Now that 'ref' is the contextual task, and any ID/UUID is chopped off the
|
||||
// elements vector, DOM resolution is now simple.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue