aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/ntfs3/index.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-12-30 14:09:44 +0400
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 16:59:15 +0400
commit30200ef8d1368f0dee424d5926bd7af0cdc87b54 (patch)
tree6453506eac7b1ecbaaa2a6d9ec52dabfe0ace9a4 /fs/ntfs3/index.c
parentfs/ntfs3: Check for extremely large size of $AttrDef (diff)
downloadwireguard-linux-30200ef8d1368f0dee424d5926bd7af0cdc87b54.tar.xz
wireguard-linux-30200ef8d1368f0dee424d5926bd7af0cdc87b54.zip
fs/ntfs3: Restore overflow checking for attr size in mi_enum_attr
Fixed comment. Removed explicit initialization for INDEX_ROOT. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/index.c')
-rw-r--r--fs/ntfs3/index.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 8718df791a55..9fefeac5fe7e 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -994,7 +994,7 @@ struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni,
struct ATTR_LIST_ENTRY *le = NULL;
struct ATTRIB *a;
const struct INDEX_NAMES *in = &s_index_names[indx->type];
- struct INDEX_ROOT *root = NULL;
+ struct INDEX_ROOT *root;
a = ni_find_attr(ni, NULL, &le, ATTR_ROOT, in->name, in->name_len, NULL,
mi);
@@ -1007,8 +1007,9 @@ struct INDEX_ROOT *indx_get_root(struct ntfs_index *indx, struct ntfs_inode *ni,
root = resident_data_ex(a, sizeof(struct INDEX_ROOT));
/* length check */
- if (root && offsetof(struct INDEX_ROOT, ihdr) + le32_to_cpu(root->ihdr.used) >
- le32_to_cpu(a->res.data_size)) {
+ if (root &&
+ offsetof(struct INDEX_ROOT, ihdr) + le32_to_cpu(root->ihdr.used) >
+ le32_to_cpu(a->res.data_size)) {
return NULL;
}