summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libexec/ftpd/ftpcmd.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index 714fb491763..8c06e2b5921 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpcmd.y,v 1.30 2002/01/08 01:55:27 millert Exp $ */
+/* $OpenBSD: ftpcmd.y,v 1.31 2002/01/17 05:27:35 itojun Exp $ */
/* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */
/*
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94";
#else
-static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.30 2002/01/08 01:55:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.31 2002/01/17 05:27:35 itojun Exp $";
#endif
#endif /* not lint */
@@ -1508,9 +1508,14 @@ sizecmd(filename)
(void) fclose(fin);
return;
}
+ if (stbuf.st_size > 10240) {
+ reply(550, "%s: file too large for SIZE.", filename);
+ (void) fclose(fin);
+ return;
+ }
count = 0;
- while((c=getc(fin)) != EOF) {
+ while((c = getc(fin)) != EOF) {
if (c == '\n') /* will get expanded to \r\n */
count++;
count++;