Skip to content
Snippets Groups Projects
Commit 6a387932 authored by rswindell's avatar rswindell
Browse files

Fixed crash when calling getHostNameByAddr() with a NULL address.

parent 908796ad
Branches
Tags
No related merge requests found
......@@ -106,6 +106,8 @@ const char* getHostNameByAddr(const char* str)
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif
if(str==NULL)
return NULL;
if((ip=inet_addr(str)) == INADDR_NONE)
return str;
if((h=gethostbyaddr((char *)&ip,sizeof(ip),AF_INET))==NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment