Fix BSS buffer overflow in makeargv().

This commit is contained in:
Tim J. Robbins 2003-10-12 00:27:55 +00:00
parent 63d707097e
commit 7f3a5689e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121015

View File

@ -85,7 +85,8 @@ int connected;
char mode[32];
char line[MAXLINE];
int margc;
char *margv[20];
#define MAX_MARGV 20
char *margv[MAX_MARGV];
jmp_buf toplevel;
volatile int txrx_error;
@ -719,7 +720,7 @@ makeargv()
margc = 0;
if ((cp = strchr(line, '\n')))
*cp = '\0';
for (cp = line; *cp;) {
for (cp = line; margc < MAX_MARGV - 1 && *cp;) {
while (isspace(*cp))
cp++;
if (*cp == '\0')