tizen: thordown: fix to check partition size more than 4GB 78/134378/1 accepted/tizen/4.0/unified/20170816.015754 accepted/tizen/4.0/unified/20170828.222115 accepted/tizen/unified/20170629.085434 submit/tizen/20170619.032200 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100008 submit/tizen_4.0_unified/20170814.115522
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 16 Jun 2017 06:56:06 +0000 (15:56 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 16 Jun 2017 06:56:09 +0000 (15:56 +0900)
The routine to check file size larger than partitione is introducetd,
but it only checks partition size with 32 bit variable, so partition
larger than 4GB is not properly checked. So this patch fixes to
check partition size with 64 bit for more than 4GB partition.

Change-Id: If22c12e9d0678ea571ca3c382b46f5ae93036025
Fixes: cecbd73e488f ("tizen: thordown: fix to check larger file size than partition size")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
property/thor_mode.c

index e277eba183162442d2702d0e024e4f85ea497798..6e3a104f0b6cc849ce3b6861eb155bd0eb87ed52 100644 (file)
@@ -178,7 +178,8 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
                        ret = rsp->ack;
                }
 
-               if (thor_file_size > part_info.size * part_info.blksz) {
+               if ((uint64_t)thor_file_size >
+                   (uint64_t)part_info.size * (uint64_t)part_info.blksz) {
                        thor_debug("Too large binary\n");
                        rsp->ack = -EFBIG;
                        ret = rsp->ack;