mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-07 18:02:15 +08:00
Merge pull request #4720 from geniusgogo/fix_shell
fix shell msh_exec memory over-bound.
This commit is contained in:
@@ -374,7 +374,7 @@ int msh_exec(char *cmd, rt_size_t length)
|
||||
int cmd_ret;
|
||||
|
||||
/* strim the beginning of command */
|
||||
while (*cmd == ' ' || *cmd == '\t')
|
||||
while ((length > 0) && (*cmd == ' ' || *cmd == '\t'))
|
||||
{
|
||||
cmd++;
|
||||
length--;
|
||||
|
||||
Reference in New Issue
Block a user