apache / mynewt-core

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
825 stars 369 forks source link

stm32: Fix flash write #3261

Closed kasjer closed 3 months ago

kasjer commented 3 months ago

Code could corrupt stack when writing to flash that requires write of size greater then 1.

memset function used for filling buffer so writes have correct number of bytes incorrectly cast buffer to (uint32_t *) and then added number of bytes resulting in possible write to unintended stack memory.