Skip to content

Commit c63369e

Browse files
committed
updat HISTORY
1 parent edb20f6 commit c63369e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

HISTORY.rst

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ XXXX-XX-XX
77

88
**Bug fixes**
99

10+
- 1179_: [Linux] Process cmdline() now takes into account misbehaving processes
11+
renaming the command line and using inappropriate chars to separate args.
1012
- 1595_: [Windows] Process.kill() may not throw AccessDenied.
1113
- 1616_: use of Py_DECREF instead of Py_CLEAR will result in double free and
1214
segfault (CVE). (patch by Riccardo Schirone)

psutil/_pslinux.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1651,9 +1651,8 @@ def cmdline(self):
16511651
data = data[:-1]
16521652
cmdline = data.split(sep)
16531653
# Sometimes last char is a null byte '\0' but the args are
1654-
# separated by spaces, see:
1655-
# https://github.com/giampaolo/psutil/
1656-
# issues/1179#issuecomment-552984549
1654+
# separated by spaces, see: https://github.com/giampaolo/psutil/
1655+
# issues/1179#issuecomment-552984549
16571656
if sep == '\x00' and len(cmdline) == 1 and ' ' in data:
16581657
cmdline = data.split(' ')
16591658
return cmdline

psutil/tests/test_linux.py

+2
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,8 @@ def test_cmdline_spaces_mocked(self):
18381838
assert m.called
18391839

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

0 commit comments

Comments
 (0)