mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-24 23:18:23 +00:00
nsh: Fix a potential buffer overflow in cmd help
Follow https://github.com/apache/nuttx-apps/pull/1621, fix issue of builtin command list. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
dd2c3b3f6a
commit
dbf7d34a2a
1 changed files with 5 additions and 1 deletions
|
|
@ -813,7 +813,11 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
|||
unsigned int j;
|
||||
unsigned int k;
|
||||
unsigned int offset;
|
||||
char line[HELP_LINELEN];
|
||||
|
||||
/* Extra 5 bytes for tab before newline and '\0' */
|
||||
|
||||
char line[HELP_LINELEN + HELP_TABSIZE + 1];
|
||||
|
||||
static const char *g_builtin_prompt = "\nBuiltin Apps:\n";
|
||||
|
||||
/* Count the number of built-in commands and get the optimal column width */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue