summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ftp/ftp.c')
-rw-r--r--usr.bin/ftp/ftp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 14c2866b599..24990c955aa 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.43 2002/02/19 19:39:38 millert Exp $ */
+/* $OpenBSD: ftp.c,v 1.44 2002/04/25 10:58:05 itojun 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.43 2002/02/19 19:39:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.44 2002/04/25 10:58:05 itojun Exp $";
#endif
#endif /* not lint */
@@ -400,9 +400,10 @@ getreply(expecteof)
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;
}