From dc2dc9d0582cbc0465e7bb913adb10f83e87585e Mon Sep 17 00:00:00 2001 From: Bob Abeles Date: Mon, 6 Nov 2023 08:24:41 -0800 Subject: [PATCH] Fix off-by-one in flash block read with fake MBR --- supervisor/shared/flash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 53815c9836..9d885cd267 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -105,6 +105,7 @@ static mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t n if (num_blocks > 1) { dest += 512; num_blocks -= 1; + block_num += 1; // Fall through and do a read from flash. } else { return 0; // Done and ok.