Skip to content

Commit

Permalink
updat HISTORY
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Nov 22, 2019
1 parent edb20f6 commit c63369e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ XXXX-XX-XX

**Bug fixes**

- 1179_: [Linux] Process cmdline() now takes into account misbehaving processes
renaming the command line and using inappropriate chars to separate args.
- 1595_: [Windows] Process.kill() may not throw AccessDenied.
- 1616_: use of Py_DECREF instead of Py_CLEAR will result in double free and
segfault (CVE). (patch by Riccardo Schirone)
Expand Down
5 changes: 2 additions & 3 deletions psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,8 @@ def cmdline(self):
data = data[:-1]
cmdline = data.split(sep)
# Sometimes last char is a null byte '\0' but the args are
# separated by spaces, see:
# https://github.com/giampaolo/psutil/
# issues/1179#issuecomment-552984549
# separated by spaces, see: https://github.com/giampaolo/psutil/
# issues/1179#issuecomment-552984549
if sep == '\x00' and len(cmdline) == 1 and ' ' in data:
cmdline = data.split(' ')
return cmdline
Expand Down
2 changes: 2 additions & 0 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,8 @@ def test_cmdline_spaces_mocked(self):
assert m.called

def test_cmdline_mixed_separators(self):
# https://github.com/giampaolo/psutil/issues/
# 1179#issuecomment-552984549
p = psutil.Process()
fake_file = io.StringIO(u('foo\x20bar\x00'))
with mock.patch('psutil._common.open',
Expand Down

0 comments on commit c63369e

Please sign in to comment.