summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft2.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mdk-stage1/dietlibc/libcruft/dnscruft2.c b/mdk-stage1/dietlibc/libcruft/dnscruft2.c
index 539c6c1c7..d4e132e42 100644
--- a/mdk-stage1/dietlibc/libcruft/dnscruft2.c
+++ b/mdk-stage1/dietlibc/libcruft/dnscruft2.c
@@ -43,18 +43,14 @@ int __dns_gethostbyx_r(const char* name, struct hostent* result,
int size;
if (lookfor==1) {
- /* FIXME: what does this magic constant mean? */
- result->h_aliases=(char**)(buf+2*sizeof(char*)*4);
result->h_addrtype=AF_INET;
result->h_length=4;
- result->h_addr_list=(char**)buf;
} else {
- /* FIXME: what does this magic constant mean? */
- result->h_aliases=(char**)(buf+2*sizeof(char*)*16);
result->h_addrtype=AF_INET6;
result->h_length=16;
- result->h_addr_list=(char**)buf;
}
+ result->h_aliases=(char**)(buf+8*sizeof(char*));
+ result->h_addr_list=(char**)buf;
result->h_aliases[0]=0;
cur=buf+16*sizeof(char*);
@@ -115,7 +111,7 @@ invalidpacket:
else
result->h_aliases[names-1]=cur;
result->h_aliases[names]=0;
- ++names;
+ if (names<8) ++names;
/* cur+=slen+1; */
cur+=(slen|3)+1;
result->h_addr_list[ips++] = cur;