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)