提交 6c010835 编写于 作者: xpxyr's avatar xpxyr

fix shell msh_exec memory over-bound.

上级 19de22f4
......@@ -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--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册