Fix BSS buffer overflow in makeargv().
This commit is contained in:
parent
cb8b38ab31
commit
fef194d740
@ -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…
x
Reference in New Issue
Block a user