From b9eb467ecf8c1087508dbee4f61ba907611170eb Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Mon, 9 Dec 2019 20:16:49 +0100 Subject: [PATCH] Command line: Restrict verify to length of binary file. --- src/platforms/pc/cl_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platforms/pc/cl_utils.c b/src/platforms/pc/cl_utils.c index 810e2516..0f4fc04d 100644 --- a/src/platforms/pc/cl_utils.c +++ b/src/platforms/pc/cl_utils.c @@ -308,7 +308,8 @@ int cl_execute(BMP_CL_OPTIONS_t *opt) " bytes to %s\n", opt->opt_flash_start, opt->opt_flash_size, opt->opt_flash_file); uint32_t flash_src = opt->opt_flash_start; - size_t size = opt->opt_flash_size; + size_t size = (opt->opt_mode == BMP_MODE_FLASH_READ) ? opt->opt_flash_size: + map.size; int bytes_read = 0; void *flash = map.data; while (size) {