I was wrong - the original commit was correct. Assume a write op on the last word: address of 0xxxxxfe and count of 2. It is a valid operation and address+count is == STM32_FLASH_SIZE - so that is OK

This commit is contained in:
David Sidrane
2016-12-08 21:14:31 +00:00
parent 946fb8334b
commit dd309ad9e8
+1 -1
View File
@@ -313,7 +313,7 @@ ssize_t up_progmem_write(size_t addr, const void *buf, size_t count)
addr -= STM32_FLASH_BASE;
}
if ((addr+count) >= STM32_FLASH_SIZE)
if ((addr+count) > STM32_FLASH_SIZE)
{
return -EFAULT;
}