Skip to content

Commit

Permalink
Fix crash when creating address from 17 char string.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Aug 12, 2024
1 parent b6a169f commit 7bdcae5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NimBLEAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NimBLEAddress::NimBLEAddress(const std::string& addr, uint8_t type) {
if (addr.length() == 17) {
std::string mac{addr};
mac.erase(std::remove(mac.begin(), mac.end(), ':'), mac.end());
uint64_t address = std::stoul(mac, nullptr, 16);
uint64_t address = std::stoull(mac, nullptr, 16);
memcpy(this->val, &address, sizeof this->val);
return;
}
Expand Down

0 comments on commit 7bdcae5

Please sign in to comment.