Use hwaddr for address calculations to avoid 32-bit overflow. Resolves: Coverity CID 1685517
Reported-by: Alistair Francis <[email protected]> Signed-off-by: Tao Ding <[email protected]> --- hw/misc/k230_decomp_gzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/k230_decomp_gzip.c b/hw/misc/k230_decomp_gzip.c index ac06cc1571..da4dc6f954 100644 --- a/hw/misc/k230_decomp_gzip.c +++ b/hw/misc/k230_decomp_gzip.c @@ -59,7 +59,7 @@ static hwaddr k230_decomp_gzip_output_addr(K230DecompGzipState *s) static hwaddr k230_decomp_gzip_input_addr(K230DecompGzipState *s) { - return s->input.slot * K230_DECOMP_GZIP_BLOCK_SIZE + + return (hwaddr) s->input.slot * K230_DECOMP_GZIP_BLOCK_SIZE + K230_DECOMP_GZIP_SRAM_IN_BASE; } -- 2.43.0
