From c547fa8ebd516b071d62feb58ad0c9fbc358ac0d Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Wed, 18 Aug 2004 00:44:56 +0000 Subject: [PATCH] FIX: Core dump on failed name lookup. --- stepmania/src/ezsockets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ezsockets.cpp b/stepmania/src/ezsockets.cpp index 44173594b9..027ad83387 100644 --- a/stepmania/src/ezsockets.cpp +++ b/stepmania/src/ezsockets.cpp @@ -10,7 +10,6 @@ #include "global.h" // StepMania only includes - #if defined(_XBOX) #elif defined(_WINDOWS) // We need the WinSock32 Library on Windows #pragma comment(lib,"wsock32.lib") @@ -159,6 +158,8 @@ bool EzSockets::connect(const std::string& host,unsigned short port) #elif defined(_WINDOWS) struct hostent* phe; phe = gethostbyname(host.c_str()); + if (phe == NULL) + return false; addr.sin_addr = *((LPIN_ADDR)* phe->h_addr_list); #else inet_pton(AF_INET,host.c_str(), &addr.sin_addr);