Skip to content

Commit

Permalink
Fixed a case when the address is NULL (found on Cygwin)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris committed Jul 26, 2024
1 parent e5aa2dc commit b8fbbc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions srtcore/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ vector<LocalInterface> GetLocalInterfaces()
while (pUnicast)
{
LocalInterface a;
a.addr = pUnicast->Address.lpSockaddr;
if (pUnicast->Address.lpSockaddr)
a.addr = pUnicast->Address.lpSockaddr;
if (a.addr.len > 0)
{
// DO NOT collect addresses that are not of
Expand All @@ -527,7 +528,8 @@ vector<LocalInterface> GetLocalInterfaces()
for (pif = pifa; pif; pif = pif->ifa_next)
{
LocalInterface i;
i.addr = pif->ifa_addr;
if (pif->ifa_addr)
i.addr = pif->ifa_addr;
if (i.addr.len > 0)
{
// DO NOT collect addresses that are not of
Expand Down

0 comments on commit b8fbbc5

Please sign in to comment.