]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a couple of Coverity Unintended sign extension sign extension
authortruckman <truckman@FreeBSD.org>
Wed, 25 May 2016 15:49:29 +0000 (15:49 +0000)
committertruckman <truckman@FreeBSD.org>
Wed, 25 May 2016 15:49:29 +0000 (15:49 +0000)
commit1b6bea5af7a2f9cfe3b236490851d8df4e27098d
tree6e139f6374a5415b3b5ad88c8a1ccd61e7808d06
parent4122004b6c02f0c54d5381e35543c4413bee2cd4
Fix a couple of Coverity Unintended sign extension sign extension
defects.  When shifting an unsigned byte into the upper 8 bits of
an int and the resulting value is greater than 0x7FFFFFF, the result
will be sign extended when converting to a 64 bit unsigned long.
Fix by casting to (uint64_t) before the shift.

Reported by: Coverity
CID: 13560441356045
Reviewed by: ken
sbin/camcontrol/camcontrol.c