Skip to content
Snippets Groups Projects
Commit 7f8ad34b authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Glen Nakamura made his fix look even better!

parent a9c03024
No related branches found
No related tags found
No related merge requests found
......@@ -530,8 +530,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
struct hostent hostentry;
char *h_addr_list[2];
struct in_addr addrentry;
char h_name[1];
} *buf = (struct namebuf *)malloc(sizeof(struct namebuf)+128);
char h_name[128];
} *buf = (struct namebuf *)malloc(sizeof(struct namebuf));
if(!buf)
return NULL; /* major failure */
*bufp = (char *)buf;
......@@ -545,8 +545,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
h->h_addrtype = AF_INET;
h->h_length = sizeof(*addrentry);
h->h_name = &buf->h_name[0];
MakeIP(ntohl(in), h->h_name,
sizeof(struct namebuf)+128 - (long)(h->h_name) + (long)buf);
MakeIP(ntohl(in), h->h_name, sizeof(buf->h_name));
}
#if defined(HAVE_GETHOSTBYNAME_R)
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment