summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/appl/gssftp/ftp/ChangeLog6
-rw-r--r--src/appl/gssftp/ftp/ftp_var.h4
-rw-r--r--src/appl/gssftp/ftp/main.c9
3 files changed, 16 insertions, 3 deletions
diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog
index 1b78353208..385036d2b5 100644
--- a/src/appl/gssftp/ftp/ChangeLog
+++ b/src/appl/gssftp/ftp/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-08 Ken Raeburn <raeburn@mit.edu>
+
+ * main.c (makeargv): Report an error if parsed arguments won't fit
+ in margv array.
+ * ftp_var.h (line, argbuf): Extend to 500 bytes.
+
2002-08-29 Ken Raeburn <raeburn@mit.edu>
* Makefile.in: Revert $(S)=>/ change, for Windows support.
diff --git a/src/appl/gssftp/ftp/ftp_var.h b/src/appl/gssftp/ftp/ftp_var.h
index 79928b3f34..4448448aa3 100644
--- a/src/appl/gssftp/ftp/ftp_var.h
+++ b/src/appl/gssftp/ftp/ftp_var.h
@@ -131,9 +131,9 @@ extern struct servent *sp; /* service spec for tcp/ftp */
#include <setjmp.h>
extern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
-extern char line[200]; /* input line buffer */
+extern char line[500]; /* input line buffer */
extern char *stringbase; /* current scan point in line buffer */
-extern char argbuf[200]; /* argument storage buffer */
+extern char argbuf[500]; /* argument storage buffer */
extern char *argbase; /* current storage point in arg buffer */
extern int margc; /* count of arguments on input line */
extern char *margv[20]; /* args parsed from input line */
diff --git a/src/appl/gssftp/ftp/main.c b/src/appl/gssftp/ftp/main.c
index 60171da55c..8e4cfe5efd 100644
--- a/src/appl/gssftp/ftp/main.c
+++ b/src/appl/gssftp/ftp/main.c
@@ -430,8 +430,15 @@ void makeargv()
stringbase = line; /* scan from first of buffer */
argbase = argbuf; /* store from first of buffer */
slrflag = 0;
- while ((*argp++ = slurpstring()))
+ while ((*argp++ = slurpstring())) {
margc++;
+ if (margc == sizeof(margv)/sizeof(margv[0])) {
+ printf("sorry, too many arguments in input line\n");
+ margc = 0;
+ margv[0] = 0;
+ return;
+ }
+ }
}
/*