Skip to content

Commit 9bdc5b8

Browse files
authored
Merge pull request libarchive#2668 from stoeckmann/7z_oob
7zip: Fix out of boundary access
2 parents 0931c12 + c069145 commit 9bdc5b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libarchive/archive_read_support_format_7zip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
/*
8181
* ELF format
8282
*/
83-
#define ELF_HDR_MIN_LEN 0x34
83+
#define ELF_HDR_MIN_LEN 0x3f
8484
#define ELF_HDR_EI_CLASS_OFFSET 0x04
8585
#define ELF_HDR_EI_DATA_OFFSET 0x05
8686

@@ -811,6 +811,8 @@ find_elf_data_sec(struct archive_read *a)
811811
strtab_size = (*dec32)(
812812
h + e_shstrndx * e_shentsize + 0x14);
813813
}
814+
if (strtab_size < 6 || strtab_size > SIZE_MAX)
815+
break;
814816

815817
/*
816818
* Read the STRTAB section to find the .data offset

0 commit comments

Comments
 (0)