MediaTek-Labs / Arduino-Add-On-for-LinkIt-SDK

Arduino board support package for LinkIt 7697
https://docs.labs.mediatek.com/resource/linkit7697-arduino/en
34 stars 33 forks source link

LBLEAddress constructor incorrectly initializes the m_addr private struct #88

Closed sfyang closed 6 years ago

sfyang commented 6 years ago

In commit 651f479 which rewrote the constructor of the LBLEAddress class, the memset() call initializing the m_addr is called with incorrect parameters as memset(&m_addr, sizeof(m_addr), 0); instead of memset(&m_addr, 0, sizeof(m_addr));. This is effectively equal to not initialize the m_addr struct, and has not caused error by luck.

pablosun commented 6 years ago

Thanks for catching this! It will be fixed in the next release.

pablosun commented 6 years ago

Fixed in 5f69fc7