]> git.dujemihanovic.xyz Git - u-boot.git/commit
fastboot: Fix overflow when calculating chunk size
authorSean Anderson <sean.anderson@seco.com>
Thu, 27 May 2021 16:02:34 +0000 (12:02 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 1 Jun 2021 20:48:54 +0000 (16:48 -0400)
commit89be8e31ccd1c53b010385ed0807eb00f0eec06a
tree376f13956ee8596593a158d5d65c07b3a6daf1af
parentd8729a114e1e98806cffb87d2dca895f99a0170a
fastboot: Fix overflow when calculating chunk size

If a chunk was larger than 4GiB, then chunk_data_sz would overflow and
blkcnt would not be calculated correctly. Upgrade it to a u64 and cast
its multiplicands as well. Also fix bytes_written while we're at it.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
lib/image-sparse.c