Fixed possible null dereferencings

A null directory pointer could appear as being dereferenced. Fix that,
though it probably never occurs in real conditions.
This commit is contained in:
Jean-Pierre André 2020-08-14 12:03:09 +02:00
parent cd68a084fc
commit 39579a045d

View File

@ -2026,7 +2026,7 @@ static int ntfs_fuse_create(const char *org_path, mode_t typemode, dev_t dev,
if (!dir_ni || (dir_ni->mft_no == FILE_Extend)) { if (!dir_ni || (dir_ni->mft_no == FILE_Extend)) {
free(path); free(path);
res = -errno; res = -errno;
if (dir_ni->mft_no == FILE_Extend) if (dir_ni)
res = -EPERM; res = -EPERM;
goto exit; goto exit;
} }
@ -2373,7 +2373,7 @@ static int ntfs_fuse_rm(const char *org_path)
/* deny unlinking metadata files from $Extend */ /* deny unlinking metadata files from $Extend */
if (!dir_ni || (dir_ni->mft_no == FILE_Extend)) { if (!dir_ni || (dir_ni->mft_no == FILE_Extend)) {
res = -errno; res = -errno;
if (dir_ni->mft_no == FILE_Extend) if (dir_ni)
res = -EPERM; res = -EPERM;
goto exit; goto exit;
} }