diff options
author | Prasanna Santhanam <tsp@qubole.com> | 2015-07-21 14:46:08 +0530 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2015-11-02 12:45:30 -0800 |
commit | aed3d8b75a49ca85a322cf95d6b6dcc1131619fd (patch) | |
tree | 941472a183685fc1213cc198c4b0f4ebf2f8d71e | |
parent | 7400ce4fd80fc6c0cfc1b3d96900ee2fb87f9ebe (diff) |
compare end of key file before reading it
-rw-r--r-- | paramiko/pkey.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py index c8f84e0a..db5b77ac 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -274,7 +274,7 @@ class PKey (object): start += 1 # find end end = start - while (lines[end].strip() != '-----END ' + tag + ' PRIVATE KEY-----') and (end < len(lines)): + while end < len(lines) and lines[end].strip() != '-----END ' + tag + ' PRIVATE KEY-----': end += 1 # if we trudged to the end of the file, just try to cope. try: |