diff options
author | Dominique Martinet <dominique.martinet@atmark-techno.com> | 2023-04-03 18:09:29 +0900 |
---|---|---|
committer | Paul Wise <pabs3@bonedaddy.net> | 2023-04-03 21:02:22 +0800 |
commit | 4b2e1aa2464cfc4a29c9565c9e143b52ef8e4848 (patch) | |
tree | 5a4eb3f247f0477cb687acb03b44642e5fb4d73a /iotop/data.py | |
parent | a14256a3ff74eeee59493ac088561f1bafab85a7 (diff) | |
download | iotop-master.tar.gz |
/proc/pid/cmdline is user-controlled and not necessarily valid unicode,
just replace bogus characters like already done for /proc/pid/status.
See-also: commit 443737ec620a699286b9b2e44dbcaac53f553812
Diffstat (limited to 'iotop/data.py')
-rw-r--r-- | iotop/data.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/iotop/data.py b/iotop/data.py index f5496d0..8c1acae 100644 --- a/iotop/data.py +++ b/iotop/data.py @@ -307,7 +307,7 @@ class ProcessInfo(DumpableObject): def get_cmdline(self): # A process may exec, so we must always reread its cmdline try: - proc_cmdline = open('/proc/%d/cmdline' % self.pid) + proc_cmdline = open('/proc/%d/cmdline' % self.pid, errors='replace') cmdline = proc_cmdline.read(4096) except IOError: return '{no such process}' |