Re: [PATCH] contrib/vhost-user-blk: fix overflowing expression

2024-07-12 Thread Peter Maydell
On Fri, 12 Jul 2024 at 16:39, Stefano Garzarella wrote: > > Coverity reported: > > >>> CID 1549454: Integer handling issues (OVERFLOW_BEFORE_WIDEN) > >>> Potentially overflowing expression > "le32_to_cpu(desc->num_sectors) << 9" with type "uint32_t" > (32 bits, un

[PATCH] contrib/vhost-user-blk: fix overflowing expression

2024-07-12 Thread Stefano Garzarella
Coverity reported: >>> CID 1549454: Integer handling issues (OVERFLOW_BEFORE_WIDEN) >>> Potentially overflowing expression "le32_to_cpu(desc->num_sectors) << 9" with type "uint32_t" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used