From: Oliver Kurth Date: Wed, 30 Oct 2019 18:18:22 +0000 (-0700) Subject: [open-vm-tools Coverity] Fix sign extension issue reported by Coverity. X-Git-Tag: stable-11.1.0~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77390236bac496d112d6bc37ffbb69123f70503f;p=thirdparty%2Fopen-vm-tools.git [open-vm-tools Coverity] Fix sign extension issue reported by Coverity. - sign_extension: Suspicious implicit sign extension: x with type uint16 (16 bits, unsigned) is promoted in (x << 16) | y to type int (32 bits, signed), then sign-extended to type unsigned long (64 bits, unsigned). If (x << 16) | y is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. File: bora-vmsoft/services/plugins/dndcp/pointer.cpp Function: PointerSetPos --- diff --git a/open-vm-tools/services/plugins/dndcp/pointer.cpp b/open-vm-tools/services/plugins/dndcp/pointer.cpp index b4cfcc4b9..c4a0fa174 100644 --- a/open-vm-tools/services/plugins/dndcp/pointer.cpp +++ b/open-vm-tools/services/plugins/dndcp/pointer.cpp @@ -215,7 +215,7 @@ PointerSetPos(uint16 x, // IN Backdoor_proto bp; bp.in.cx.halfs.low = BDOOR_CMD_SETPTRLOCATION; - bp.in.size = (x << 16) | y; + bp.in.size = (uint32) ((x << 16) | y); Backdoor(&bp); }