mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 01:07:18 +08:00
Merge pull request #3679 from DavidLin1577/patch-11
[finsh]Fixed a bug may cause stackover flow
This commit is contained in:
commit
b04fdd89ed
@ -101,6 +101,11 @@ int msh_exec_script(const char *cmd_line, int size)
|
|||||||
int length;
|
int length;
|
||||||
|
|
||||||
line_buf = (char *) rt_malloc(RT_CONSOLEBUF_SIZE);
|
line_buf = (char *) rt_malloc(RT_CONSOLEBUF_SIZE);
|
||||||
|
if (line_buf == RT_NULL)
|
||||||
|
{
|
||||||
|
close(fd);
|
||||||
|
return -RT_ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
/* read line by line and then exec it */
|
/* read line by line and then exec it */
|
||||||
do
|
do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user