Skip to content

Commit

Permalink
Convert bytes-like object to string in apport_corefile() method (#2387)
Browse files Browse the repository at this point in the history
* converting bytes-like object to string

* updated changelog

---------

Co-authored-by: peace-maker <peacemakerctf@gmail.com>
  • Loading branch information
sanjitkumar2016 and peace-maker committed May 12, 2024
1 parent fcec117 commit e92a30b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The table below shows which release corresponds to each branch, and what date th
- [#2389][2389] Fix passing bytes to `context.log_file` and `crc.BitPolynom`
- [#2391][2391] Fix error message when passing invalid kwargs to `xor`
- [#2376][2376] Return buffered data on first EOF in tube.readline()
- [#2387][2387] Convert apport_corefile() output from bytes-like object to string

[2360]: https://github.com/Gallopsled/pwntools/pull/2360
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
Expand All @@ -91,6 +92,7 @@ The table below shows which release corresponds to each branch, and what date th
[2389]: https://github.com/Gallopsled/pwntools/pull/2389
[2391]: https://github.com/Gallopsled/pwntools/pull/2391
[2376]: https://github.com/Gallopsled/pwntools/pull/2376
[2387]: https://github.com/Gallopsled/pwntools/pull/2387

## 4.13.0 (`beta`)

Expand Down
4 changes: 4 additions & 0 deletions pwnlib/elf/corefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,10 @@ def apport_read_crash_data(self):
except Exception:
pass

# Convert bytes-like object to string
if isinstance(data, bytes):
data = data.decode('utf-8')

return data

def systemd_coredump_corefile(self):
Expand Down

0 comments on commit e92a30b

Please sign in to comment.