Go to file
Jan-Philipp Litza 53e9630da1 gluon-cron: Fix endless loop parsing invalid lines
Using the line
```
* * * * echo "foobar"
```
(notice the missing fifth time field) in a crontab causes gluon-cron
to enter an endless loop while parsing it, thus it won't even execute
the other, valid crontabs.

This is caused by the loop in [line 138] where `begin - min`
substracts the unsigned `min` from the signed `begin`. If now `begin`
is invalid, `strict_atoi` returns -1 and the loop starts at
`(-1)-1=MAX_INT` and runs while `i <= MAX_INT` which is always true.

The real culprit lies in [line 134] where exactly this case
`begin < min` is checked - but because of the signedness, this check doesn't
work as expected either.

The easiest solution is to make `min` a signed integer instead of an unsigned
one, as we do not require it to be very large and only pass the constants 0 or
1 to it.

To avoid other similar problems, this patch makes the input variable `n` a
signed integer as well.
2014-08-27 10:20:04 +02:00
admin/autoupdater Dependency fixes for the new LuCi version 2014-08-06 12:06:49 +02:00
gluon gluon-cron: Fix endless loop parsing invalid lines 2014-08-27 10:20:04 +02:00
libs lua-platform-info: add support for the mpc85xx-generic target 2014-08-08 17:49:50 +02:00
net/batman-adv-legacy Remove fastd and libuecc 2014-08-06 11:47:16 +02:00
utils/ecdsautils ecdsautils: update to v0.3.2 2014-07-21 14:52:01 +02:00
.gitignore Add .gitignore 2013-09-28 19:45:19 +02:00