TheDigital1 / ESP32_BTHome

This project aims to show how you can use a ESP32 to send BLE advertisement packets in the BTHome format.
Apache License 2.0
26 stars 3 forks source link

Buffer overflow #4

Open RoganDawes opened 1 year ago

RoganDawes commented 1 year ago

Hi,

The comment on this line is incorrect: https://github.com/TheDigital1/ESP32_BTHome/blob/main/main.cpp#L46

When allocating an array of 10 items, they are numbered 0-9. All of which means that if you try to copy 11 items into the array, you will run over the end, and stomp on whatever is adjacent to the array. Please update the example to allocate 11 entries.

TheDigital1 commented 1 year ago

Ah good catch. Thx!