mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 21:41:18 +08: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:
@@ -813,7 +813,11 @@ static inline void help_builtins(FAR struct nsh_vtbl_s *vtbl)
|
|||||||
unsigned int j;
|
unsigned int j;
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
unsigned int offset;
|
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";
|
static const char *g_builtin_prompt = "\nBuiltin Apps:\n";
|
||||||
|
|
||||||
/* Count the number of built-in commands and get the optimal column width */
|
/* Count the number of built-in commands and get the optimal column width */
|
||||||
|
Reference in New Issue
Block a user