Skip to content

Commit 7129694

Browse files
authored
[finsh]Fixed a bug may cause stackover flow
add code: if (line_buf == RT_NULL) return -RT_ENOMEM;
1 parent b2e30a7 commit 7129694

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/finsh/msh_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ int msh_exec_script(const char *cmd_line, int size)
101101
int length;
102102

103103
line_buf = (char *) rt_malloc(RT_CONSOLEBUF_SIZE);
104+
if (line_buf == RT_NULL) return -RT_ENOMEM;
104105

105106
/* read line by line and then exec it */
106107
do

0 commit comments

Comments
 (0)