Skip to content

Commit

Permalink
fix for list index out of range
Browse files Browse the repository at this point in the history
to recreate bug:
pip install vorta
rm ~/.ssh/.known_hosts.lock
touch ~/.ssh/.known_hosts.lock
vorta -f

Traceback (most recent call last):
  File "/opt/anaconda/anaconda3/bin/vorta", line 10, in <module>
    sys.exit(main())
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/__main__.py", line 40, in main
    app = VortaApp(sys.argv, single_app=True)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/application.py", line 59, in __init__
    self.open_main_window_action()
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/application.py", line 80, in open_main_window_action
    self.main_window = MainWindow(self)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/views/main_window.py", line 37, in __init__
    self.repoTab = RepoTab(self.repoTabSlot)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/views/repo_tab.py", line 55, in __init__
    self.init_ssh()
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/views/repo_tab.py", line 88, in init_ssh
    keys = get_private_keys()
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/vorta/utils.py", line 74, in get_private_keys
    parsed_key = key_format.from_private_key_file(key_file)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 235, in from_private_key_file
    key = cls(filename=filename, password=password)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/paramiko/rsakey.py", line 55, in __init__
    self._from_private_key_file(filename, password)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/paramiko/rsakey.py", line 175, in _from_private_key_file
    data = self._read_private_key_file("RSA", filename, password)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 308, in _read_private_key_file
    data = self._read_private_key(tag, f, password)
  File "/opt/anaconda/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 320, in _read_private_key
    m = self.BEGIN_TAG.match(lines[start])
IndexError: list index out of range
Segmentation fault (core dumped)
  • Loading branch information
poleguy authored and bitprophet committed May 20, 2022
1 parent 114578a commit 587db0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paramiko/pkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ def _read_private_key_file(self, tag, filename, password=None):

def _read_private_key(self, tag, f, password=None):
lines = f.readlines()

if not lines:
raise SSHException("no lines in {} private key file".format(tag))

# find the BEGIN tag
start = 0
m = self.BEGIN_TAG.match(lines[start])
Expand Down

0 comments on commit 587db0f

Please sign in to comment.