[spice-gtk v1] spice-widget: Avoid promoting signed 1 on shift

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

Address sanitizer runtime error:
 > spice-widget.c:1433:12: runtime error: left shift of
 > 1 by 31 places cannot be represented in type 'int'

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/spice-widget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-widget.c b/src/spice-widget.c
index 316043a..1e7add4 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1430,7 +1430,7 @@ static void send_key(SpiceDisplay *display, int scancode, SendKeyType type, gboo
 
     i = scancode / 32;
     b = scancode % 32;
-    m = (1 << b);
+    m = (1u << b);
     g_return_if_fail(i < SPICE_N_ELEMENTS(d->key_state));
 
     switch (type) {
-- 
2.16.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]