I think, that Size is (highest address+1 - Base address)

Base address has been removed and if address+count >= size we are outside of the Flash
This commit is contained in:
David Sidrane 2016-11-01 22:27:35 +00:00
parent 8dd2494407
commit d870f4ab29
1 changed files with 1 additions and 1 deletions

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;
}