[PATCH] server: do not promote lparam to signed int (Coverity)
Marcus Meissner
marcus at jet.franken.de
Tue Jun 28 02:37:04 CDT 2011
Hi,
CID 4805.
If the vscan value is >= 32768, the 64bit lParam will have its upper
bits all set to 1 as it gets turned into a signed int.
Try to avoid this by specifying 1 to be unsigned INT.
Ciao, Marcus
---
server/queue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/server/queue.c b/server/queue.c
index 6dee8f5..92efb3d 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1617,7 +1617,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
msg->type = MSG_HARDWARE;
msg->win = get_user_full_handle( win );
- msg->lparam = (input->kbd.scan << 16) | 1; /* repeat count */
+ msg->lparam = (input->kbd.scan << 16) | 1U; /* repeat count */
msg->time = input->kbd.time;
msg->result = NULL;
msg->data = msg_data;
--
1.7.3.4
More information about the wine-patches
mailing list