4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-18 15:53:32 +08:00

修正dfs在fd_get时,未检查有效性的问题

This commit is contained in:
shaojinchun 2018-12-10 08:33:17 +08:00
parent 538923d34e
commit 56c0df1e58

View File

@ -221,7 +221,7 @@ struct dfs_fd *fd_get(int fd)
d = fdt->fds[fd];
/* check dfs_fd valid or not */
if (d->magic != DFS_FD_MAGIC)
if ((d == NULL) || (d->magic != DFS_FD_MAGIC))
{
dfs_unlock();
return NULL;