From de4c1303f53642501be006b62d2d296043385537 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 4 Apr 2018 10:46:57 +0800 Subject: [PATCH] Coverity 189186: hrtimer calculation overflow --- lib/plat/lws-plat-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plat/lws-plat-unix.c b/lib/plat/lws-plat-unix.c index d24bd86f..9a075f97 100644 --- a/lib/plat/lws-plat-unix.c +++ b/lib/plat/lws-plat-unix.c @@ -204,7 +204,7 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) lws_pt_lock(pt, __func__); /* don't stay in poll wait longer than next hr timeout */ lws_usec_t t = __lws_hrtimer_service(pt); - if (timeout_ms * 1000 > t) + if ((lws_usec_t)timeout_ms * 1000 > t) timeout_ms = t / 1000; lws_pt_unlock(pt); }