mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-28 02:46:13 -04:00
fixed possible crash in rsnet.cc
This commit is contained in:
parent
74bb3b6a8b
commit
8fdf8f81a8
@ -81,7 +81,7 @@ bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
|
|||||||
addrinfo *info = NULL;
|
addrinfo *info = NULL;
|
||||||
int res = getaddrinfo(hostname.c_str(),NULL,NULL,&info) ;
|
int res = getaddrinfo(hostname.c_str(),NULL,NULL,&info) ;
|
||||||
|
|
||||||
if(res > 0)
|
if(res > 0 || info == NULL || info->ai_addr == NULL)
|
||||||
{
|
{
|
||||||
std::cerr << "(EE) getaddrinfo returned error " << res << " on string \"" << hostname << "\"" << std::endl;
|
std::cerr << "(EE) getaddrinfo returned error " << res << " on string \"" << hostname << "\"" << std::endl;
|
||||||
returned_addr.s_addr = 0 ;
|
returned_addr.s_addr = 0 ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user