Files
u-boot/tools
Rasmus Villemoes f08e29351d tools: mkimage: make size_inc a signed type
In the Fixes commit, I initialized size_inc from the return value of
the new fit_estimate_hash_sig_size() helper. That helper may fail and
report that by returning a negative value, but I overlooked that
size_inc had type size_t, and hence the error check doesn't work.

Change size_inc to have type int so the error check works.  Inside the
loop, it is passed to another function as a size_t parameter, but
that's fine, because we know it is non-negative, and its value may be
incremented in steps of 1024 and is capped at ~64K, so it will
certainly never overflow an int.

Fixes: 7d4eacb0e6 ("mkimage: do a rough estimate for the size needed for hashes/signatures")
Addresses-Coverity-ID: 569495: Integer handling issues  (NEGATIVE_RETURNS)
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-07-15 09:55:41 -06:00
..
2025-05-27 10:07:41 +01:00
2024-10-21 20:51:23 -06:00
2024-07-15 12:12:18 -06:00
2024-09-12 17:35:37 +02:00
2021-01-13 02:38:00 +01:00
2024-07-15 12:12:18 -06:00
2025-06-03 17:18:02 -06:00
2023-01-27 12:51:26 -05:00
2024-07-15 12:12:18 -06:00
2024-07-15 12:12:18 -06:00
2025-06-14 09:09:40 -06:00
2024-07-15 12:12:18 -06:00
2025-01-26 11:35:46 -06:00
2025-04-11 12:16:44 -06:00
2019-11-04 18:15:32 -07:00