Commit da46d0b2 authored by Tom Ferrin's avatar Tom Ferrin Committed by 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.
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment