Added out of bounds read detection for corrups section headers (#434)
authorJavier Rascón Mesa <jrm00018.tar.gz@gmail.com>
Tue, 9 Aug 2022 22:53:02 +0000 (00:53 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Aug 2022 22:53:02 +0000 (15:53 -0700)
commit45087daac5d4fe661beeb3c8884c50343e8b29a8
tree2436da0b4ae2d62b719d5bbe4b1e834953bf7fc4
parentb14841dedc329d1b72ec4974cdf04be82e227853
Added out of bounds read detection for corrups section headers (#434)

* Added test for files with corrupt e_shoff & e_shnum

* Added basic detection for reading out of the stream bounds due to corrupt header

* Added None check when accessing '_section_header_stringtable'

* Fix to work on python2

Co-authored-by: halos <halos@synth>
elftools/elf/elffile.py
test/test_corrupt_files.py [new file with mode: 0644]
test/testfiles_for_unittests/corrupt_sh.elf [new file with mode: 0755]