=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/ftp.c,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -u -r1.41 -r1.41.2.1 --- src/usr.bin/ftp/ftp.c 2001/06/26 23:44:00 1.41 +++ src/usr.bin/ftp/ftp.c 2002/05/16 21:44:27 1.41.2.1 @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp.c,v 1.41 2001/06/26 23:44:00 lebel Exp $ */ +/* $OpenBSD: ftp.c,v 1.41.2.1 2002/05/16 21:44:27 miod Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* @@ -67,7 +67,7 @@ #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 $"; +static char rcsid[] = "$OpenBSD: ftp.c,v 1.41.2.1 2002/05/16 21:44:27 miod Exp $"; #endif #endif /* not lint */ @@ -422,9 +422,10 @@ if (dig > 4 && pflag == 1 && isdigit(c)) pflag = 2; if (pflag == 2) { - if (c != '\r' && c != ')') - *pt++ = c; - else { + if (c != '\r' && c != ')') { + if (pt < &pasv[sizeof(pasv) - 1]) + *pt++ = c; + } else { *pt = '\0'; pflag = 3; }