| skipped 23 lines |
24 | 24 | | sym: lief.ELF.Symbol = elf.get_symbol("strstr") |
25 | 25 | | assert sym.imported |
26 | 26 | | |
| 27 | + | def test_issue_1023(): |
| 28 | + | """ |
| 29 | + | Make sure that get_content_from_virtual_address return an empty |
| 30 | + | buffer when trying to read bss segment |
| 31 | + | """ |
| 32 | + | elf = lief.ELF.parse(get_sample('ELF/nopie_bss_671.elf')) |
| 33 | + | |
| 34 | + | bss_segment = elf.segments[3] |
| 35 | + | bss_start = bss_segment.virtual_address + bss_segment.physical_size |
| 36 | + | bss_content = elf.get_content_from_virtual_address(bss_start + 1, 1) |
| 37 | + | |
| 38 | + | assert len(bss_content) == 0 |
| 39 | + | |