Skip to content

Commit

Permalink
Prevent division by zero
Browse files Browse the repository at this point in the history
Co-authored-by: Twice <[email protected]>
  • Loading branch information
kinoute and PragmaTwice committed Jun 11, 2024
1 parent 7bcd1d3 commit 004d303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/cron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ StatusOr<int> Cron::convertParam(const std::string &param, int lower_bound, int
// Check for interval syntax (*/n)
if (util::HasPrefix(param, "*/")) {
auto s = ParseInt<int>(param.substr(2), {lower_bound, upper_bound}, 10);
if (!s) {
if (!s || *s == 0) {
return std::move(s).Prefixed(fmt::format("malformed cron token `{}`", param));
}
is_interval = true;
Expand Down

0 comments on commit 004d303

Please sign in to comment.