From: Jihoon Kim Date: Tue, 13 Feb 2024 10:04:38 +0000 (+0900) Subject: e_comp_wl: fix overflow issue X-Git-Tag: accepted/tizen/unified/20240214.164003~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d76653650a895910b4fcbc58207398a34430065;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl: fix overflow issue Expression cancel_keycode - 8U, which is equal to 4294967288, where cancel_keycode is known to be equal to 0, underflows the type that receives it, an unsigned integer 32 bits wide. Change-Id: I3fc0178cc2159b123b5d2c637c813b958132f31f Signed-off-by: Jihoon Kim --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 7f13532fa6..0232c7b42a 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -4737,8 +4737,10 @@ e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time ELOGF("Key", "Failed to send key cancel for %d key, Cancel key is not supported\n", ec, keycode); return EINA_FALSE; } + + EINA_SAFETY_ON_TRUE_RETURN_VAL(cancel_keycode < 8, EINA_FALSE); + cancel_keycode = cancel_keycode - 8; - EINA_SAFETY_ON_TRUE_RETURN_VAL(cancel_keycode <= 0, EINA_FALSE); wl_keycode = keycode - 8; EINA_SAFETY_ON_TRUE_RETURN_VAL(wl_keycode <= 0, EINA_FALSE);