app: aboot: add integer overflow check

Add check for total number of blocks being flashed during sparse image flashing.

Change-Id: Iedc455f721b2673b83ff3dbe0bc34170988ef2f6
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index e17fc53..d689ea6 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -2848,6 +2848,13 @@
 				fill_buf[i] = fill_val;
 			}
 
+			if(total_blocks > (UINT_MAX - chunk_header->chunk_sz))
+			{
+				fastboot_fail("bogus size for chunk FILL type");
+				free(fill_buf);
+				return;
+			}
+
 			for (i = 0; i < chunk_header->chunk_sz; i++)
 			{
 				/* Make sure that the data written to partition does not exceed partition size */