summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-03-01 12:58:43 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-03-01 12:58:48 +0100
commitf9b754f0f8fc11e0ff2f9d81ae4c3ef180b286e6 (patch)
tree7051b393f453edcdc6b7218d51f5b4d382f10554
parent48378f7d944d1009989fb844f24d570178272f73 (diff)
downloadgenimage-f9b754f0f8fc11e0ff2f9d81ae4c3ef180b286e6.tar.gz
genimage-f9b754f0f8fc11e0ff2f9d81ae4c3ef180b286e6.tar.xz
image-flash: avoid potential int overflow
Convert to long long before the multiplication. Found by LGTM. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--image-flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/image-flash.c b/image-flash.c
index 79b8e31..33380b7 100644
--- a/image-flash.c
+++ b/image-flash.c
@@ -86,7 +86,7 @@ static int flash_setup(struct image *image, cfg_t *cfg)
return -EINVAL;
}
- flashsize = image->flash_type->pebsize * image->flash_type->numpebs;
+ flashsize = (unsigned long long)image->flash_type->pebsize * image->flash_type->numpebs;
list_for_each_entry(part, &image->partitions, list) {
if (last) {