diff --git a/fs/vfs/vfs_cmd/vfs_shellcmd.c b/fs/vfs/vfs_cmd/vfs_shellcmd.c index d8a4caf8..7f2050ee 100755 --- a/fs/vfs/vfs_cmd/vfs_shellcmd.c +++ b/fs/vfs/vfs_cmd/vfs_shellcmd.c @@ -838,6 +838,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname) return remove(pathname); } d = opendir(pathname); + if (d == NULL) + { + return -1; + } while (1) { dirent = readdir(d);