From 39579a045da3838a3bc0b443163fbcf5100ae7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 14 Aug 2020 12:03:09 +0200 Subject: [PATCH] Fixed possible null dereferencings A null directory pointer could appear as being dereferenced. Fix that, though it probably never occurs in real conditions. --- src/ntfs-3g.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 2fd98285..6e0d688c 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -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)) { free(path); res = -errno; - if (dir_ni->mft_no == FILE_Extend) + if (dir_ni) res = -EPERM; goto exit; } @@ -2373,7 +2373,7 @@ static int ntfs_fuse_rm(const char *org_path) /* deny unlinking metadata files from $Extend */ if (!dir_ni || (dir_ni->mft_no == FILE_Extend)) { res = -errno; - if (dir_ni->mft_no == FILE_Extend) + if (dir_ni) res = -EPERM; goto exit; }