]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
[open-vm-tools Coverity] Fix sign extension issue reported by Coverity.
authorOliver Kurth <okurth@vmware.com>
Wed, 30 Oct 2019 18:18:22 +0000 (11:18 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 30 Oct 2019 18:18:22 +0000 (11:18 -0700)
- 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

open-vm-tools/services/plugins/dndcp/pointer.cpp

index b4cfcc4b9048fd6f26d72bb75b90c0011074d153..c4a0fa174d1a67a3aeeb15422f86488a37807899 100644 (file)
@@ -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);
 }