diff options
Diffstat (limited to 'fs/ntfs3/index.c')
-rw-r--r-- | fs/ntfs3/index.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index ae9616becec1..7a1e01a2ed9a 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -848,6 +848,10 @@ static inline struct NTFS_DE *hdr_delete_de(struct INDEX_HDR *hdr, u32 off = PtrOffset(hdr, re); int bytes = used - (off + esize); + /* check INDEX_HDR valid before using INDEX_HDR */ + if (!check_index_header(hdr, le32_to_cpu(hdr->total))) + return NULL; + if (off >= used || esize < sizeof(struct NTFS_DE) || bytes < sizeof(struct NTFS_DE)) return NULL; |