Skip to content

Commit e92a30b

Browse files
Convert bytes-like object to string in apport_corefile() method (#2387)
* converting bytes-like object to string * updated changelog --------- Co-authored-by: peace-maker <[email protected]>
1 parent fcec117 commit e92a30b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ The table below shows which release corresponds to each branch, and what date th
8181
- [#2389][2389] Fix passing bytes to `context.log_file` and `crc.BitPolynom`
8282
- [#2391][2391] Fix error message when passing invalid kwargs to `xor`
8383
- [#2376][2376] Return buffered data on first EOF in tube.readline()
84+
- [#2387][2387] Convert apport_corefile() output from bytes-like object to string
8485

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

9597
## 4.13.0 (`beta`)
9698

pwnlib/elf/corefile.py

+4
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,10 @@ def apport_read_crash_data(self):
13291329
except Exception:
13301330
pass
13311331

1332+
# Convert bytes-like object to string
1333+
if isinstance(data, bytes):
1334+
data = data.decode('utf-8')
1335+
13321336
return data
13331337

13341338
def systemd_coredump_corefile(self):

0 commit comments

Comments
 (0)