mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-18 18:39:11 +08:00
fix shell msh_exec memory over-bound.
This commit is contained in:
parent
19de22f485
commit
6c01083502
@ -374,7 +374,7 @@ int msh_exec(char *cmd, rt_size_t length)
|
|||||||
int cmd_ret;
|
int cmd_ret;
|
||||||
|
|
||||||
/* strim the beginning of command */
|
/* strim the beginning of command */
|
||||||
while (*cmd == ' ' || *cmd == '\t')
|
while ((length > 0) && (*cmd == ' ' || *cmd == '\t'))
|
||||||
{
|
{
|
||||||
cmd++;
|
cmd++;
|
||||||
length--;
|
length--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user