From: Ken Raeburn Date: Sat, 9 Nov 2002 01:35:21 +0000 (+0000) Subject: * main.c (makeargv): Report an error if parsed arguments won't fit in margv X-Git-Tag: krb5-1.3-alpha1~283 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8332ab8173087562194e4306c6909863cce7cad7;p=krb5.git * main.c (makeargv): Report an error if parsed arguments won't fit in margv array. * ftp_var.h (line, argbuf): Extend to 500 bytes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14983 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog index 1b7835320..385036d2b 100644 --- a/src/appl/gssftp/ftp/ChangeLog +++ b/src/appl/gssftp/ftp/ChangeLog @@ -1,3 +1,9 @@ +2002-11-08 Ken Raeburn + + * 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 * 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 79928b3f3..4448448aa 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 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 60171da55..8e4cfe5ef 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; + } + } } /*