google-code-export / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Linux - process exe improper null bytes handling #466

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Split on first null character and return 1st item from list. It fixes issues 
such as 

>>> os.readlink("/proc/%s/exe" % 4672)
'/usr/sbin/hald\x00r\x00\x9f$+\x00\x00\xd0\x8f\xca\x9f$+\x00\x00p (deleted)'
>>> os.readlink("/proc/%s/exe" % 4672).split('\x00')[0]
'/usr/sbin/hald'
>>>

Original issue reported on code.google.com by gautam.s...@gmail.com on 23 Jan 2014 at 12:20

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in revision be986f2c2867. Thanks for the patch.

Original comment by g.rodola on 8 Feb 2014 at 7:05

GoogleCodeExporter commented 9 years ago
Closing out as fixed as 2.0.0 version is finally out.

Original comment by g.rodola on 10 Mar 2014 at 11:36