summaryrefslogtreecommitdiff
path: root/fs/ntfs3/index.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-12-29 15:44:43 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 16:59:14 +0400
commitfc4992458e0aa2d2e82a25c922e6ac36c2d91083 (patch)
tree893b5deb614ec3f569c11afbbbb39ad1fb48a02e /fs/ntfs3/index.c
parente479f0a62a2a4358f25d0d0b60c333e6d881d7c6 (diff)
fs/ntfs3: Add null pointer checks
Added null pointer checks in function ntfs_security_init. Also added le32_to_cpu in functions ntfs_security_init and indx_read. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/index.c')
-rw-r--r--fs/ntfs3/index.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index f716487ec8a0..8718df791a55 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1102,7 +1102,8 @@ ok:
}
/* check for index header length */
- if (offsetof(struct INDEX_BUFFER, ihdr) + ib->ihdr.used > bytes) {
+ if (offsetof(struct INDEX_BUFFER, ihdr) + le32_to_cpu(ib->ihdr.used) >
+ bytes) {
err = -EINVAL;
goto out;
}