Skip to content

Commit 3f236bd

Browse files
swan886mark
andauthored
Problem: ziflist_new may cause crash when windows returns empty FriendlyName
Solution: ignores network interfaces with empty FriendlyName Co-authored-by: mark <[email protected]>
1 parent 5b5c640 commit 3f236bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ziflist.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ s_reload (ziflist_t *self, bool ipv6)
372372
PIP_ADAPTER_PREFIX pPrefix = cur_address->FirstPrefix;
373373

374374
PWCHAR friendlyName = cur_address->FriendlyName;
375+
if (friendlyName == NULL) {
376+
cur_address = cur_address->Next;
377+
continue;
378+
}
375379
size_t asciiSize = wcstombs (0, friendlyName, 0) + 1;
376380
char *asciiFriendlyName = (char *) zmalloc (asciiSize);
377381
wcstombs (asciiFriendlyName, friendlyName, asciiSize);

0 commit comments

Comments
 (0)