mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-22 10:20:52 +00:00
Still unknown as to why, but the call to `nc->GetProperties()` can fail when setting a friendly name on the Windows virtual ethernet adapter. Ensure that `ncp` is not null before continuing and accessing the device GUID.
This commit is contained in:
parent
936dda4773
commit
6cf3b65953
@ -850,6 +850,7 @@ void WindowsEthernetTap::setFriendlyName(const char *dn)
|
|||||||
NETCON_PROPERTIES *ncp = nullptr;
|
NETCON_PROPERTIES *ncp = nullptr;
|
||||||
nc->GetProperties(&ncp);
|
nc->GetProperties(&ncp);
|
||||||
|
|
||||||
|
if (ncp != nullptr) {
|
||||||
GUID curId = ncp->guidId;
|
GUID curId = ncp->guidId;
|
||||||
if (curId == _deviceGuid) {
|
if (curId == _deviceGuid) {
|
||||||
wchar_t wtext[255];
|
wchar_t wtext[255];
|
||||||
@ -857,6 +858,7 @@ void WindowsEthernetTap::setFriendlyName(const char *dn)
|
|||||||
nc->Rename(wtext);
|
nc->Rename(wtext);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
nc->Release();
|
nc->Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user