mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 13:13:31 +08:00
修正dfs在fd_get时,未检查有效性的问题
This commit is contained in:
parent
538923d34e
commit
56c0df1e58
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user