mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-08 05:57:19 +00:00
nsh: fix a buffer overflow in help
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
902a1d7ece
commit
105fd2aac5
1 changed files with 3 additions and 3 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
|||
return;
|
||||
}
|
||||
|
||||
column_width += 2;
|
||||
column_width += HELP_TABSIZE;
|
||||
|
||||
/* 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));
|
||||
for (i = 0; i < num_builtin_rows; i++)
|
||||
{
|
||||
offset = 4;
|
||||
offset = HELP_TABSIZE;
|
||||
memset(line, ' ', offset);
|
||||
|
||||
for (j = 0, k = i;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue