Browse Source

Merge pull request #2050 from jesven/lwp-mcore

修正dfs在fd_get时,未检查有效性的问题
Bernard Xiong 6 years ago
parent
commit
09a9e82fef
1 changed files with 1 additions and 1 deletions
  1. 1 1
      components/dfs/src/dfs.c

+ 1 - 1
components/dfs/src/dfs.c

@@ -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;