From 7cbf0dbf5c98d10023125b06b5d4b737c246aacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwenol=C3=A9=20Beauchesne?= Date: Thu, 20 Feb 2003 14:52:10 +0000 Subject: Fix mygethostbyaddr(), struct in is not a NULL terminated string. i.e. len has to be either sizeof(in.s_addr) or INADDRSZ. --- mdk-stage1/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdk-stage1/dns.c b/mdk-stage1/dns.c index c0fc655d2..266864d37 100644 --- a/mdk-stage1/dns.c +++ b/mdk-stage1/dns.c @@ -67,7 +67,7 @@ char * mygethostbyaddr(char * ipnum) struct hostent * host; if (!inet_aton(ipnum, &in)) return NULL; - host = gethostbyaddr(&in, strlen((void *) &in), AF_INET); + host = gethostbyaddr(&in.s_addr, sizeof(in.s_addr) /* INADDRSZ */, AF_INET); if (host && host->h_name) return host->h_name; return NULL; -- cgit v1.2.1