mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Ensure IDs are non-zero
This fixes out-of-bounds accesses in several subcommands when the invalid ID @0 is passed to the program.
This commit is contained in:
parent
9489ed5b70
commit
48aa9cfdc0
2 changed files with 6 additions and 1 deletions
|
@ -412,7 +412,8 @@ void CLI::identifyIds ()
|
|||
int digits;
|
||||
if (pig.skipLiteral ("@") &&
|
||||
pig.getDigits (digits) &&
|
||||
pig.eos ())
|
||||
pig.eos () &&
|
||||
digits > 0)
|
||||
{
|
||||
a.tag ("ID");
|
||||
a.attribute ("value", digits);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue