diff --git a/fs/vfs/vfs_cmd/vfs_shellcmd.c b/fs/vfs/vfs_cmd/vfs_shellcmd.c index 0c95699e..29aa4bd0 100644 --- a/fs/vfs/vfs_cmd/vfs_shellcmd.c +++ b/fs/vfs/vfs_cmd/vfs_shellcmd.c @@ -837,6 +837,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);