mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02: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
1 changed files with 8 additions and 6 deletions
|
@ -850,12 +850,14 @@ void WindowsEthernetTap::setFriendlyName(const char *dn)
|
|||
NETCON_PROPERTIES *ncp = nullptr;
|
||||
nc->GetProperties(&ncp);
|
||||
|
||||
GUID curId = ncp->guidId;
|
||||
if (curId == _deviceGuid) {
|
||||
wchar_t wtext[255];
|
||||
mbstowcs(wtext, dn, strlen(dn)+1);
|
||||
nc->Rename(wtext);
|
||||
found = true;
|
||||
if (ncp != nullptr) {
|
||||
GUID curId = ncp->guidId;
|
||||
if (curId == _deviceGuid) {
|
||||
wchar_t wtext[255];
|
||||
mbstowcs(wtext, dn, strlen(dn)+1);
|
||||
nc->Rename(wtext);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
nc->Release();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue