From 93445482c0b20a39ecb89bcb6c03921d41f8c9e7 Mon Sep 17 00:00:00 2001 From: chengyechun Date: Thu, 10 Nov 2022 20:09:22 +0800 Subject: [PATCH] fix for list index out of range --- ...port-fix-for-list-index-out-of-range.patch | 28 +++++++++++++++++++ python-paramiko.spec | 9 +++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-fix-for-list-index-out-of-range.patch diff --git a/backport-fix-for-list-index-out-of-range.patch b/backport-fix-for-list-index-out-of-range.patch new file mode 100644 index 0000000..e2cd97e --- /dev/null +++ b/backport-fix-for-list-index-out-of-range.patch @@ -0,0 +1,28 @@ +From 587db0f2075bc9b4342ca6524831e85ccf7f72dd Mon Sep 17 00:00:00 2001 +From: Nicholas Dietz +Date: Sat, 21 May 2022 3:03:20 AM GMT+0800 +Subject: [PATCH] pkey:fix for list index out of range + +Conflict:NA +Reference:https://github/paramiko/paramiko/commit/587db0f2075bc9b4342ca6524831e85ccf7f72dd + +--- + paramiko/pkey.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/paramiko/pkey.py b/paramiko/pkey.py +index 585cb74..0566efc 100644 +--- a/paramiko/pkey.py ++++ b/paramiko/pkey.py +@@ -324,6 +324,8 @@ class PKey(object): + + 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 +-- +2.23.0 + diff --git a/python-paramiko.spec b/python-paramiko.spec index 7e90787..89d2ff9 100644 --- a/python-paramiko.spec +++ b/python-paramiko.spec @@ -1,6 +1,6 @@ Name: python-paramiko Version: 2.11.0 -Release: 2 +Release: 3 Summary: Python SSH module License: LGPLv2+ URL: https://github.com/paramiko/paramiko @@ -11,6 +11,7 @@ Source0: https://github.com/paramiko/paramiko/archive/%{version}/paramiko- Patch6000: backport-Skip-tests-requiring-invoke.patch Patch6001: 0003-remove-pytest-relaxed-dep.patch Patch6002: backport-fix-error-in-sftp-testcase.patch +Patch6003: backport-fix-for-list-index-out-of-range.patch BuildArch: noarch @@ -69,6 +70,12 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-%{python3_version} %doc html/ demos/ NEWS README.rst %changelog +* Thu Nov 10 2022 chengyechun - 2.11.0-3 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix for list index out of range + * Mon Oct 31 2022 chengyechun - 2.11.0-2 - Type:bugfix - CVE:NA -- Gitee