diff options
author | Rasmus Villemoes <ravi@prevas.dk> | 2025-07-09 10:34:49 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-07-15 09:55:41 -0600 |
commit | f08e29351dcb4c07c940b8a4c6b7b3899b803980 (patch) | |
tree | 0fe8e3e4cbb0c8d1a21efeb05d4cf6c7ba2e0e87 /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | |
parent | 9204cae0937c0e26fcff1ee08e51ef37f59844fe (diff) |
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: 7d4eacb0e68 ("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>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c')
0 files changed, 0 insertions, 0 deletions