|
|
249a24 |
From b608ab801c6dfd5babd224d5f8a21010ccb64b28 Mon Sep 17 00:00:00 2001
|
|
|
249a24 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
249a24 |
Date: Thu, 6 Apr 2017 17:21:29 +0100
|
|
|
249a24 |
Subject: [PATCH] Avoid sign extension warnings from coverity
|
|
|
249a24 |
|
|
|
249a24 |
src/vncconnection.c:3082: sign_extension:
|
|
|
249a24 |
Suspicious implicit sign extension: "height" with type "unsigned short"
|
|
|
249a24 |
(16 bits, unsigned) is promoted in "rowlen * height" to type "int"
|
|
|
249a24 |
(32 bits, signed), then sign-extended to type "unsigned long"
|
|
|
249a24 |
(64 bits, unsigned). If "rowlen * height" is greater than 0x7FFFFFFF,
|
|
|
249a24 |
the upper bits of the result will all be 1.
|
|
|
249a24 |
|
|
|
249a24 |
The 'rowlen' variable is initialization from the unsigned width
|
|
|
249a24 |
variable, so should have used uint instead of int.
|
|
|
249a24 |
|
|
|
249a24 |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
249a24 |
(cherry picked from commit c3e5d23d67c9a209f127caab7843d94a91031a5f)
|
|
|
249a24 |
---
|
|
|
249a24 |
src/vncconnection.c | 2 +-
|
|
|
249a24 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
249a24 |
|
|
|
249a24 |
diff --git a/src/vncconnection.c b/src/vncconnection.c
|
|
|
249a24 |
index 19dbfee..c55f71d 100644
|
|
|
249a24 |
--- a/src/vncconnection.c
|
|
|
249a24 |
+++ b/src/vncconnection.c
|
|
|
249a24 |
@@ -3064,7 +3064,7 @@ static void vnc_connection_xcursor(VncConnection *conn, guint16 x, guint16 y, gu
|
|
|
249a24 |
guint8 *pixbuf = NULL;
|
|
|
249a24 |
guint8 *data, *mask, *datap, *maskp;
|
|
|
249a24 |
guint32 *pixp;
|
|
|
249a24 |
- int rowlen;
|
|
|
249a24 |
+ guint rowlen;
|
|
|
249a24 |
int x1, y1;
|
|
|
249a24 |
guint8 fgrgb[3], bgrgb[3];
|
|
|
249a24 |
guint32 fg, bg;
|