app: aboot: fix incorrect check for integer overflow

When we encounter a large DONTCARE chunk, the integer overflow check that was
implemented in commit 14cff317 will report a false failure.

For example, the following chunk header was observed:

[58840] === Chunk Header ===
[58840] chunk_type: 0xcac3
[58850] chunk_data_sz: 0x198ffe
[58850] total_size: 0xc

which is valid, but reported as:

"Bogus size sparse and chunk header"

The check for the 32-bit overflow when computing the actual chunk size should be
done only for RAW chunk, instead.

Issue: FP2A10-106
Signed-off-by: Nicolas Dechesne <>
Change-Id: I89930a66448b4d3baaba3bc28227572362679caf
1 file changed