diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:10:34 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:10:34 +0000 |
commit | 8e8408c65078c4f4c171e5cc2b567d6705bed024 (patch) | |
tree | 1605641dff9d3858f2b1595d8885bb0fe9496f34 /lib/ext2fs/dir_iterate.c | |
parent | 037a031cb6f2d5e4575a3028e3c7135c59ee805a (diff) | |
parent | 63687023fc2e8871a718cb4e18458eece2e3460c (diff) | |
download | e2fsprogs-8e8408c65078c4f4c171e5cc2b567d6705bed024.tar.gz |
Snap for 10453563 from 63687023fc2e8871a718cb4e18458eece2e3460c to mainline-uwb-releaseaml_uwb_341710010aml_uwb_341513070aml_uwb_341511050aml_uwb_341310300aml_uwb_341310030aml_uwb_341111010aml_uwb_341011000android14-mainline-uwb-release
Change-Id: Ib8f5c32e208ea07a1c7814b337878a6d47c59923
Diffstat (limited to 'lib/ext2fs/dir_iterate.c')
-rw-r--r-- | lib/ext2fs/dir_iterate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c index b2b77693..7798a482 100644 --- a/lib/ext2fs/dir_iterate.c +++ b/lib/ext2fs/dir_iterate.c @@ -221,6 +221,10 @@ int ext2fs_process_dir_block(ext2_filsys fs, if (ext2fs_has_feature_metadata_csum(fs->super)) csum_size = sizeof(struct ext2_dir_entry_tail); + if (buflen < 8) { + ctx->errcode = EXT2_ET_DIR_CORRUPTED; + return BLOCK_ABORT; + } while (offset < buflen - 8) { dirent = (struct ext2_dir_entry *) (ctx->buf + offset); if (ext2fs_get_rec_len(fs, dirent, &rec_len)) |