[finsh]Fixed a bug may cause stackover flow

add code:
if (line_buf == RT_NULL) return -RT_ENOMEM;
This commit is contained in:
David Lin 2020-06-12 08:49:46 +08:00 committed by GitHub
parent b2e30a7efe
commit 7129694f38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -101,6 +101,7 @@ 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) return -RT_ENOMEM;
/* read line by line and then exec it */ /* read line by line and then exec it */
do do