]> git.dujemihanovic.xyz Git - u-boot.git/commit
cmd: mtd: avoid unintentional integer overflow
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 11 Jan 2024 07:31:55 +0000 (08:31 +0100)
committerDario Binacchi <dario.binacchi@amarulasolutions.com>
Mon, 15 Jan 2024 07:58:24 +0000 (08:58 +0100)
commit6b37320c7625a7742a6aeac4f9835356b782633c
tree7ca66a358a5e145723e0998eb6800cc5a72ac0b6
parent697758e7c81131da6db0e3b10515019fe3aca8c9
cmd: mtd: avoid unintentional integer overflow

mtd dump beyond 4 GiB will show incorrect results.

Multiplying two u32 will yield a u32. Add a missing cast.

Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
Addresses-Coverity-ID: 477205 ("Unintentional integer overflow")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/all/20240111073155.19545-1-heinrich.schuchardt@canonical.com
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
cmd/mtd.c