diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index 06ba9fa84dc4..bbbb4b99ca4b 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: uucpd.c,v 1.9 1997/02/22 14:22:39 peter Exp $ + * $Id: uucpd.c,v 1.10 1997/03/25 09:52:38 davidn Exp $ */ #ifndef lint @@ -55,6 +55,7 @@ static char sccsid[] = "@(#)uucpd.c 8.1 (Berkeley) 6/4/93"; #include #include #include +#include #include #include #include @@ -117,7 +118,7 @@ void main(int argc, char **argv) void badlogin(char *name, struct sockaddr_in *sin) { - char remotehost[32]; + char remotehost[MAXHOSTNAMELEN]; struct hostent *hp = gethostbyaddr((char *)&sin->sin_addr, sizeof (struct in_addr), AF_INET); @@ -128,6 +129,8 @@ void badlogin(char *name, struct sockaddr_in *sin) strncpy(remotehost, inet_ntoa(sin->sin_addr), sizeof (remotehost)); + remotehost[sizeof remotehost - 1] = '\0'; + syslog(LOG_NOTICE, "LOGIN FAILURE FROM %s", remotehost); syslog(LOG_AUTHPRIV|LOG_NOTICE, "LOGIN FAILURE FROM %s, %s", remotehost, name); @@ -242,7 +245,7 @@ void dologout(void) void dologin(struct passwd *pw, struct sockaddr_in *sin) { char line[32]; - char remotehost[32]; + char remotehost[MAXHOSTNAMELEN]; int f; time_t cur_time; struct hostent *hp = gethostbyaddr((char *)&sin->sin_addr,