Fixed possible crash on huge timer tick for polls with close date.

This commit is contained in:
23rd
2026-04-01 20:40:17 +03:00
committed by John Preston
parent bcaa449510
commit 2c003bc22e
+3 -1
View File
@@ -4489,7 +4489,9 @@ void Session::checkPollsClosings() {
}
}
if (closest) {
_pollsClosingTimer.callOnce((closest - now) * crl::time(1000));
constexpr auto kMaxTimeout = 24 * 3600 * crl::time(1000);
_pollsClosingTimer.callOnce(
std::min((closest - now) * crl::time(1000), kMaxTimeout));
} else {
_pollsClosingTimer.cancel();
}