Colin Ian King 97a103e6b5 ipmi_si: fix potential integer overflow on large shift
Shifting unsigned char b by an int type can lead to sign-extension
overflow. For example, if b is 0xff and the shift is 24, then top
bit is sign-extended so the final value passed to writeq has all
the upper 32 bits set.  Fix this by casting b to a 64 bit unsigned
before the shift.

Detected by CoverityScan, CID#1465246 ("Unintended sign extension")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2018-09-18 16:15:33 -05:00
..
2018-03-14 19:13:47 +01:00
2018-06-05 11:24:55 -07:00
2017-08-28 17:11:28 +02:00
2018-07-03 13:01:57 +02:00
2011-03-31 11:26:23 -03:00
2018-08-18 11:04:51 -07:00
2018-05-16 07:23:35 +02:00
2016-01-22 18:04:28 -05:00
2018-06-12 16:19:22 -07:00
2018-08-02 17:16:03 +02:00