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

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;