nsh: fix a buffer overflow in help
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
902a1d7ece
commit
105fd2aac5
@ -675,7 +675,7 @@ static inline void help_cmdlist(FAR struct nsh_vtbl_s *vtbl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
colwidth += 2;
|
colwidth += HELP_TABSIZE;
|
||||||
|
|
||||||
/* Determine the number of commands to put on one line */
|
/* Determine the number of commands to put on one line */
|
||||||
|
|
||||||
@ -890,7 +890,7 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
column_width += 2;
|
column_width += HELP_TABSIZE;
|
||||||
|
|
||||||
/* Determine the number of commands to put on one line */
|
/* Determine the number of commands to put on one line */
|
||||||
|
|
||||||
@ -913,7 +913,7 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
|||||||
nsh_write(vtbl, g_builtin_prompt, strlen(g_builtin_prompt));
|
nsh_write(vtbl, g_builtin_prompt, strlen(g_builtin_prompt));
|
||||||
for (i = 0; i < num_builtin_rows; i++)
|
for (i = 0; i < num_builtin_rows; i++)
|
||||||
{
|
{
|
||||||
offset = 4;
|
offset = HELP_TABSIZE;
|
||||||
memset(line, ' ', offset);
|
memset(line, ' ', offset);
|
||||||
|
|
||||||
for (j = 0, k = i;
|
for (j = 0, k = i;
|
||||||
|
Loading…
Reference in New Issue
Block a user