提交 c1b2b3c7 编写于 作者: O openharmony_ci 提交者: Gitee

!203 fix rm -r crash when opendir failed

Merge pull request !203 from 野生毛霉君/master
...@@ -837,6 +837,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname) ...@@ -837,6 +837,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
return remove(pathname); return remove(pathname);
} }
d = opendir(pathname); d = opendir(pathname);
if (d == NULL)
{
return -1;
}
while (1) while (1)
{ {
dirent = readdir(d); dirent = readdir(d);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册