=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/ftp.c,v retrieving revision 1.40 retrieving revision 1.41 diff -c -r1.40 -r1.41 *** src/usr.bin/ftp/ftp.c 2001/06/23 22:48:44 1.40 --- src/usr.bin/ftp/ftp.c 2001/06/26 23:44:00 1.41 *************** *** 1,4 **** ! /* $OpenBSD: ftp.c,v 1.40 2001/06/23 22:48:44 millert Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ftp.c,v 1.41 2001/06/26 23:44:00 lebel Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* *************** *** 67,73 **** #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.40 2001/06/23 22:48:44 millert Exp $"; #endif #endif /* not lint */ --- 67,73 ---- #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else ! static char rcsid[] = "$OpenBSD: ftp.c,v 1.41 2001/06/26 23:44:00 lebel Exp $"; #endif #endif /* not lint */ *************** *** 174,183 **** } if (res0->ai_canonname) ! strncpy(hostnamebuf, res0->ai_canonname, sizeof(hostnamebuf)); else ! strncpy(hostnamebuf, host, sizeof(hostnamebuf)); ! hostnamebuf[sizeof(hostnamebuf) - 1] = '\0'; hostname = hostnamebuf; s = -1; --- 174,182 ---- } if (res0->ai_canonname) ! strlcpy(hostnamebuf, res0->ai_canonname, sizeof(hostnamebuf)); else ! strlcpy(hostnamebuf, host, sizeof(hostnamebuf)); hostname = hostnamebuf; s = -1; *************** *** 453,460 **** if (len > sizeof(reply_string)) len = sizeof(reply_string); ! (void)strncpy(reply_string, current_line, len); ! reply_string[len] = '\0'; } if (continuation && code != originalcode) { if (originalcode == 0) --- 452,458 ---- if (len > sizeof(reply_string)) len = sizeof(reply_string); ! (void)strlcpy(reply_string, current_line, len + 1); } if (continuation && code != originalcode) { if (originalcode == 0) *************** *** 1638,1645 **** ip->connect = connected; connected = op->connect; if (hostname) { ! (void)strncpy(ip->name, hostname, sizeof(ip->name) - 1); ! ip->name[sizeof(ip->name) - 1] = '\0'; } else ip->name[0] = '\0'; hostname = op->name; --- 1636,1642 ---- ip->connect = connected; connected = op->connect; if (hostname) { ! (void)strlcpy(ip->name, hostname, sizeof(ip->name)); } else ip->name[0] = '\0'; hostname = op->name; *************** *** 1665,1683 **** mcase = op->mcse; ip->ntflg = ntflag; ntflag = op->ntflg; ! (void)strncpy(ip->nti, ntin, sizeof(ip->nti) - 1); ! (ip->nti)[sizeof(ip->nti) - 1] = '\0'; (void)strcpy(ntin, op->nti); ! (void)strncpy(ip->nto, ntout, sizeof(ip->nto) - 1); ! (ip->nto)[sizeof(ip->nto) - 1] = '\0'; (void)strcpy(ntout, op->nto); ip->mapflg = mapflag; mapflag = op->mapflg; ! (void)strncpy(ip->mi, mapin, sizeof(ip->mi) - 1); ! (ip->mi)[sizeof(ip->mi) - 1] = '\0'; (void)strcpy(mapin, op->mi); ! (void)strncpy(ip->mo, mapout, sizeof(ip->mo) - 1); ! (ip->mo)[sizeof(ip->mo) - 1] = '\0'; (void)strcpy(mapout, op->mo); (void)signal(SIGINT, oldintr); if (abrtflag) { --- 1662,1676 ---- mcase = op->mcse; ip->ntflg = ntflag; ntflag = op->ntflg; ! (void)strlcpy(ip->nti, ntin, sizeof(ip->nti)); (void)strcpy(ntin, op->nti); ! (void)strlcpy(ip->nto, ntout, sizeof(ip->nto)); (void)strcpy(ntout, op->nto); ip->mapflg = mapflag; mapflag = op->mapflg; ! (void)strlcpy(ip->mi, mapin, sizeof(ip->mi)); (void)strcpy(mapin, op->mi); ! (void)strlcpy(ip->mo, mapout, sizeof(ip->mo)); (void)strcpy(mapout, op->mo); (void)signal(SIGINT, oldintr); if (abrtflag) {