Skip to content
  • Uri Lublin's avatar
    Cursor: ignore big cursors · 1f80431a
    Uri Lublin authored and Frediano Ziglio's avatar Frediano Ziglio committed
    
    
    Return early if the cursor received from X is too big.
    
    This fixes a covscan error: "sign_extension: Suspicious implicit sign extension":
      "cursor->width" with type "unsigned short" (16 bits, unsigned) is promoted in
      "cursor->width * cursor->height" to type "int" (32 bits, signed), then sign-extended
      to type "unsigned long" (64 bits, unsigned). If "cursor->width * cursor->height" is
      greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
    
    Signed-off-by: default avatarUri Lublin <uril@redhat.com>
    Acked-by: default avatarFrediano Ziglio <fziglio@redhat.com>
    1f80431a