From 67ad6e45dbc22a7272e933fd0a2171378026f43c Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 12 Jan 2018 12:38:25 +0100 Subject: [PATCH] Add assertion that checks for a maximum msecs value for sys_timeout() --- src/core/timeouts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/timeouts.c b/src/core/timeouts.c index 71811b16..585eb3ce 100644 --- a/src/core/timeouts.c +++ b/src/core/timeouts.c @@ -290,6 +290,8 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) LWIP_ASSERT_CORE_LOCKED(); + LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4)); + next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ #if LWIP_DEBUG_TIMERNAMES