Fix BSS buffer overflow in makeargv().
This commit is contained in:
parent
63d707097e
commit
7f3a5689e7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121015
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user