Skip to content
Commit b1d030f8 authored by Colin Ian King's avatar Colin Ian King Committed by Boris Brezillon
Browse files

mtd: sharpslpart: fix overflow on block_adr calculation



Multiplying block_num and mtd->erasesize may potentially overflow
as they are both unsigned ints and so the multiplication is evaluated
in unsigned int arithmetic.  Cast block_adr to off_t to ensure
multiplication is off_t sized to avoid any potential overflow.

Detected by CoverityScan, CID#1461264 ("Unintentional integer overflow")

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarAndrea Adami <andrea.adami@gmail.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 9e343e87
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment