File tree 3 files changed +6
-3
lines changed
3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ XXXX-XX-XX
7
7
8
8
**Bug fixes **
9
9
10
+ - 1179 _: [Linux] Process cmdline() now takes into account misbehaving processes
11
+ renaming the command line and using inappropriate chars to separate args.
10
12
- 1595 _: [Windows] Process.kill() may not throw AccessDenied.
11
13
- 1616 _: use of Py_DECREF instead of Py_CLEAR will result in double free and
12
14
segfault (CVE). (patch by Riccardo Schirone)
Original file line number Diff line number Diff line change @@ -1651,9 +1651,8 @@ def cmdline(self):
1651
1651
data = data [:- 1 ]
1652
1652
cmdline = data .split (sep )
1653
1653
# 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
1657
1656
if sep == '\x00 ' and len (cmdline ) == 1 and ' ' in data :
1658
1657
cmdline = data .split (' ' )
1659
1658
return cmdline
Original file line number Diff line number Diff line change @@ -1838,6 +1838,8 @@ def test_cmdline_spaces_mocked(self):
1838
1838
assert m .called
1839
1839
1840
1840
def test_cmdline_mixed_separators (self ):
1841
+ # https://github.com/giampaolo/psutil/issues/
1842
+ # 1179#issuecomment-552984549
1841
1843
p = psutil .Process ()
1842
1844
fake_file = io .StringIO (u ('foo\x20 bar\x00 ' ))
1843
1845
with mock .patch ('psutil._common.open' ,
You can’t perform that action at this time.
0 commit comments