• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 44163421512
74%

Build:
DEFAULT BRANCH: dev
Ran 17 Nov 2026 08:01PM UTC
Jobs 1
Files 152
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Nov 2026 07:53PM UTC coverage: 73.897% (-0.02%) from 73.915%
44163421512

push

github

web-flow
elf: don't invert the zero-fill range when p_memsz < p_filesz (#2807)

* elf: don't invert the zero-fill range when p_memsz < p_filesz

_populate_memory adds the bss range unconditionally:

    stop_data = start + p_filesz
    stop_mem  = start + p_memsz
    ...
    if stop_data != stop_mem:
        self.memory.addi(stop_data, stop_mem, b'\x00')

A PT_LOAD that declares p_memsz < p_filesz is malformed, but it is not
rejected by the rest of the ecosystem: readelf prints "the segment's file
size is larger than its memory size" and carries on with exit 0, and
pyelftools parses it without complaint. Here stop_mem < stop_data, the
interval is inverted, and intervaltree refuses to store it at all:

    ValueError: IntervalTree: Null Interval objects not allowed in
    IntervalTree: Interval(549755819176, 5288, ...)

so ELF() raises on a file every other tool loads.

Clamp the in-memory end to the file end before the interval is built. The
file data still gets mapped; there is simply no extra memory beyond it to
zero-fill.

Verified with a 120-byte ELF64 carrying one malformed PT_LOAD:

    p_memsz < p_filesz   before: ValueError       after: OK
    p_memsz > p_filesz   before: OK               after: OK
    p_memsz == p_filesz  before: OK               after: OK

And the three normal binaries I checked map identically before and after --
/bin/cat and /bin/ls both give 9 intervals and 29753 / 138705 loaded bytes,
/python3 gives 9 intervals and entry 0x658320 -- so the clamp is not
reached for well-formed input.

Fixes #2805.

* Update CHANGELOG

---------

Co-authored-by: peace-maker <peacemakerctf@gmail.com>

4030 of 6770 branches covered (59.53%)

1 of 2 new or added lines in 1 file covered. (50.0%)

3 existing lines in 1 file now uncovered.

13812 of 18691 relevant lines covered (73.9%)

0.74 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
78.03
-0.06% pwnlib/elf/elf.py

Coverage Regressions

Lines Coverage ∆ File
3
69.95
-0.48% pwnlib/elf/corefile.py
Jobs
ID Job ID Ran Files Coverage
1 44163421512.1 17 Nov 2026 08:01PM UTC 152
73.9
GitHub Action Run
Source Files on build 44163421512
  • Tree
  • List 152
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • c45cbebe on github
  • Prev Build on dev (#44159654607)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc