提交 da46d0b2 编写于 作者: T Tom Ferrin 提交者: Me No Dev

FIX: getEfuseMac can return random data (#1059)

esp_efuse_mac_get_default() only stores into the bottom 6 bytes of it's 8-byte argument, so must initialize this arg to zero to avoid trash on the stack.
上级 8e29347d
......@@ -218,7 +218,7 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
uint64_t EspClass::getEfuseMac(void)
{
uint64_t _chipmacid;
uint64_t _chipmacid = 0LL;
esp_efuse_mac_get_default((uint8_t*) (&_chipmacid));
return _chipmacid;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册