commit 61e6b5c0aaf8516ed686a40f40133cb1996f2a65 from: Florian Westphal date: Wed Jan 02 11:03:29 2008 UTC [Resolver]: Use dotted-decimal IP address if hostname is >= 64 commit - 91a6fffaa01be7b84d1f072d474c7c2181b00ab6 commit + 61e6b5c0aaf8516ed686a40f40133cb1996f2a65 blob - dbf28736ab8c2329705be524c5d893be5266e230 blob + 1bd7e293127a8a59ba35eef65feacd4b70cc7503 --- src/ngircd/resolve.c +++ src/ngircd/resolve.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: resolve.c,v 1.27 2007/11/25 18:42:37 fw Exp $"; +static char UNUSED id[] = "$Id: resolve.c,v 1.28 2008/01/02 11:03:29 fw Exp $"; #include "imp.h" #include @@ -153,8 +153,8 @@ Do_ResolveAddr( struct sockaddr_in *Addr, int identsoc /* Resolver sub-process: resolve IP address and write result into * pipe to parent. */ - char hostname[HOST_LEN]; - char ipstr[HOST_LEN]; + char hostname[CLIENT_HOST_LEN]; + char ipstr[CLIENT_HOST_LEN]; struct hostent *h; size_t len; struct in_addr *addr; @@ -169,7 +169,7 @@ Do_ResolveAddr( struct sockaddr_in *Addr, int identsoc Log_Resolver( LOG_DEBUG, "Now resolving %s ...", inet_ntoa( Addr->sin_addr )); #endif h = gethostbyaddr( (char *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET ); - if (!h) { + if (!h || strlen(h->h_name) >= sizeof(hostname)) { #ifdef h_errno Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\": %s!", inet_ntoa( Addr->sin_addr ), Get_Error( h_errno )); #else