tizen: thordown: fix to check larger file size than partition size 93/123493/1 accepted/tizen/unified/20170406.055840 submit/tizen/20170406.031953 tizen_4.0.m1_release
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 6 Apr 2017 01:06:13 +0000 (10:06 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 6 Apr 2017 01:06:15 +0000 (10:06 +0900)
If the file is larger than its mapped partition size, then it should
be failed to thor command. So, this patch fixes to check requested
file size.

Change-Id: I87a3c825138b93ebba961227e47a8cf600de602d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
property/thor_mode.c

index 4845b16..e277eba 100644 (file)
@@ -178,6 +178,12 @@ 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) {
+                       thor_debug("Too large binary\n");
+                       rsp->ack = -EFBIG;
+                       ret = rsp->ack;
+               }
+
                break;
        case RQT_DL_FILE_START:
                send_rsp(rsp);