Skip to content

Commit 3ff0c07

Browse files
authored
Merge pull request #3960 from z14git/master
[shell] Ensure that the last char of `char line[]` is '\0'
2 parents 8fc2f6e + adceb3e commit 3ff0c07

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

components/finsh/shell.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct finsh_shell
7878
struct finsh_parser parser;
7979
#endif
8080

81-
char line[FINSH_CMD_SIZE];
81+
char line[FINSH_CMD_SIZE + 1];
8282
rt_uint16_t line_position;
8383
rt_uint16_t line_curpos;
8484

@@ -107,4 +107,3 @@ const char *finsh_get_password(void);
107107
#endif
108108

109109
#endif
110-

0 commit comments

Comments
 (0)