aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Anderson <saa@android.com>2012-02-07 17:35:38 -0800
committerMike J. Chen <mjchen@google.com>2012-03-03 17:29:34 -0800
commitdce61faf4aa32d65f24daa683b82cf0af221232e (patch)
treeb16a4ba757f2ab3f2b77ed1efcc9fd0072fd9211
parentc5c854c5ea01985063048db35a092e4bd968e1a3 (diff)
downloaduboot-dce61faf4aa32d65f24daa683b82cf0af221232e.tar.gz
FASTBOOT: Fix handling of sparse Don't Care chunks that span 4GB
A cast to u64 was missing so when the length of the chunk was calculated, it was truncated to a 32 bit value. Change-Id: Ia761f984bd65c24a77a1bdc0c094df5479c53f17 Signed-off-by: Scott Anderson <saa@android.com>
-rw-r--r--common/cmd_fastboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index ee8dc11fe..32d9f026a 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -942,7 +942,7 @@ static int _unsparse(unsigned char *source,
printf("sparse: bogus DONT CARE chunk\n");
return 1;
}
- clen = chunk->chunk_sz * header->blk_sz;
+ clen = (u64)chunk->chunk_sz * header->blk_sz;
FBTDBG("sparse: DONT_CARE blk=%d bsz=%d:"
" skip(sector=%lu,clen=%llu)\n",
chunk->chunk_sz, header->blk_sz, sector, clen);