Skip to content

Commit

Permalink
check if ":" exists before index(':') (#1159)
Browse files Browse the repository at this point in the history
* check if ":" exists before index(':')

* Update proc.py
  • Loading branch information
excalibur44 authored and zachriggle committed Jun 4, 2018
1 parent 26e6bce commit f4159bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pwnlib/util/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ def status(pid):
try:
with open('/proc/%d/status' % pid) as fd:
for line in fd:
if ':' not in line:
continue
i = line.index(':')
key = line[:i]
val = line[i + 2:-1] # initial :\t and trailing \n
Expand Down

0 comments on commit f4159bd

Please sign in to comment.