summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-20 14:52:10 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-20 14:52:10 +0000
commit7cbf0dbf5c98d10023125b06b5d4b737c246aacc (patch)
tree0b9cd4b3dd4fc22249778938fe60815b7da82943
parent06966a71712bf50d28f1b0f79ae6489fbdaf8667 (diff)
downloaddrakx-backup-do-not-use-7cbf0dbf5c98d10023125b06b5d4b737c246aacc.tar
drakx-backup-do-not-use-7cbf0dbf5c98d10023125b06b5d4b737c246aacc.tar.gz
drakx-backup-do-not-use-7cbf0dbf5c98d10023125b06b5d4b737c246aacc.tar.bz2
drakx-backup-do-not-use-7cbf0dbf5c98d10023125b06b5d4b737c246aacc.tar.xz
drakx-backup-do-not-use-7cbf0dbf5c98d10023125b06b5d4b737c246aacc.zip
Fix mygethostbyaddr(), struct in is not a NULL terminated string.
i.e. len has to be either sizeof(in.s_addr) or INADDRSZ.
-rw-r--r--mdk-stage1/dns.c2
1 files changed, 1 insertions, 1 deletions
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;