zero {host,serv}ent_data before passing it to the system functions to avoid crashing (see #10332)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-25 12:45:29 +00:00
parent 9f403f22f8
commit 1c8a2d1b92

View File

@@ -2068,6 +2068,7 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname)
struct hostent h;
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_3)
struct hostent_data buffer;
memset(&buffer, 0, sizeof(buffer));
#else
char buffer[1024];
#endif
@@ -2125,6 +2126,7 @@ GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
#if defined(HAVE_FUNC_GETSERVBYNAME_R_4)
struct servent_data buffer;
memset(&buffer, 0, sizeof(buffer));
#else
char buffer[1024];
#endif
@@ -2183,6 +2185,7 @@ GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t
struct hostent temphost;
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_3)
struct hostent_data buffer;
memset(&buffer, 0, sizeof(buffer));
#else
char buffer[1024];
#endif