Re: [PATCH] atm: he: fix sign-extension overflow on large shift

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Tue, 15 Jan 2019 18:03:38 +0000

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> 
> Shifting the 1 by exp by an int can lead to sign-extension overlow when
> exp is 31 since 1 is an signed int and sign-extending this result to an
> unsigned long long will set the upper 32 bits.  Fix this by shifting an
> unsigned long.
> 
> Detected by cppcheck:
> (warning) Shifting signed 32-bit value by 31 bits is undefined behaviour
> 
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Applied.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux