Package: task
Version: 2.5.1+dfsg-8
Severity: important

--- Please enter the report below this line. ---

When a recurring task contains "P2M" period, a generation of next child
spins forever in generateDueDates(). Patch attached.

--- System information. ---
Architecture: 
Kernel:       Linux 5.5.4mq+

Debian Release: 10.3
  900 stable-debug    debug.mirrors.debian.org 
  900 stable          security.debian.org 
  900 stable          ftp.pl.debian.org 
  900 stable          dl.winehq.org 
  900 proposed-updates ftp.pl.debian.org 
  850 buster-backports ftp.pl.debian.org 
  800 testing         ftp.pl.debian.org 
  700 unstable        ftp.pl.debian.org 
  600 experimental    ftp.pl.debian.org 
  540 oldstable-proposed-updates ftp.pl.debian.org 
  540 oldstable       security.debian.org 
  540 oldstable       ftp.pl.debian.org 
  500 unstable-debug  debug.mirrors.debian.org 
  500 testing-debug   debug.mirrors.debian.org 
  500 stable          repository.spotify.com 
  500 stable          dl.google.com 
  100 buster-backports-debug debug.mirrors.debian.org 
    1 experimental-debug debug.mirrors.debian.org 

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.

Index: task-2.5.1+dfsg/src/recur.cpp
===================================================================
--- task-2.5.1+dfsg.orig/src/recur.cpp
+++ task-2.5.1+dfsg/src/recur.cpp
@@ -268,7 +268,10 @@ ISO8601d getNextRecurrence (ISO8601d& cu
            Lexer::isAllDigits (period.substr (1, period.length () - 2)) &&
            period[period.length () - 1] == 'M')
   {
-    int increment = strtol (period.substr (0, period.length () - 1).c_str (), NULL, 10);
+    int increment = strtol (period.substr (1, period.length () - 2).c_str (), NULL, 10);
+
+    if (increment <= 0)
+      throw std::string (format (STRING_TASK_VALID_RECUR, period));
 
     m += increment;
     while (m > 12)

Reply via email to