HomeFreeBSD

aic7xxx(4): Fix unintended sign extension in ahd_inq()

Description

aic7xxx(4): Fix unintended sign extension in ahd_inq()

ahd_inb() returns type uint8_t. The shift left by untyped 24 implicitly
promotes the result to type (signed) int. Then the binary OR with uint64_t
values sign-extends the integer. If bit 31 of the read value happened to be
set, the 64-bit result would have all upper 32 bits set to 1 due to OR. This
is clearly not intended.

Reported by: Coverity
CID: 980473 (old one!)

Details

Provenance
cemAuthored on
Parents
rS357299: contrib/apr: Remove scope leak UB
Branches
Unknown
Tags
Unknown