Files
Cole MunzandGitHub 376dc488f5 js_event_loop: reject a non-positive timer interval (#4425)
eventLoop.timer(mode, interval) passes interval straight into
furi_ms_to_ticks() with no validation. For a periodic timer an interval
of 0 divides by zero in furi_event_loop_process_expired_timers()
(elapsed_time / timer->interval) and is counted as expired on every
event-loop pass, so a one-line script - eventLoop.timer("periodic", 0) -
pins the thread running the loop.

Reject interval <= 0 at the binding with a normal script-level error,
matching how the other js_app modules report bad arguments. The <= 0
check also covers negative values that would otherwise wrap to a huge
interval when cast to uint32_t.

Signed-off-by: Cole Munz <colemunz@gmail.com>
2026-07-27 20:36:49 +03:00
..
2024-10-14 19:42:11 +01:00