shared/calendarspec: abort calculation after 1000 iterations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 21 Mar 2021 19:59:32 +0000 (20:59 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 23 Mar 2021 09:01:17 +0000 (10:01 +0100)
commitf14b80e09e225ccf7cfd8a85578b7e64c3fdebb9
tree23e0fa3d8882e9fb0b424c052c91277478d038e1
parent78415ea9f7de25fc883af980e91fbffadd5a38b5
shared/calendarspec: abort calculation after 1000 iterations

We have a bug where we seem to enter an infinite loop when running in the
Europe/Dublin timezone. The timezone is "special" because it has negative SAVE
values. The handling of this should obviously be fixed, but let's use a
belt-and-suspenders approach, and gracefully fail if we fail to find an answer
within a specific number of attempts. The code in this function is rather
complex, and it's hard to rule out another bug in the future.

(cherry picked from commit 169615c9a8cdc54d748d4dfc8279be9b3c2bec44)
src/shared/calendarspec.c