mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-28 02:03:20 +08:00
[finsh]Fixed a bug may cause stackover flow
add code: if (line_buf == RT_NULL) return -RT_ENOMEM;
This commit is contained in:
@@ -101,6 +101,7 @@ int msh_exec_script(const char *cmd_line, int size)
|
||||
int length;
|
||||
|
||||
line_buf = (char *) rt_malloc(RT_CONSOLEBUF_SIZE);
|
||||
if (line_buf == RT_NULL) return -RT_ENOMEM;
|
||||
|
||||
/* read line by line and then exec it */
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user