4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-02 13:15:31 +08:00

Merge pull request #2050 from jesven/lwp-mcore

修正dfs在fd_get时,未检查有效性的问题
This commit is contained in:
Bernard Xiong 2018-12-10 09:21:10 +08:00 committed by GitHub
commit 09a9e82fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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