openvpn-authenticator: Don't process configuration when row is too short

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2022-06-14 15:53:19 +00:00
parent 59f9e41361
commit b6f9fff2bc

View File

@@ -277,8 +277,8 @@ class OpenVPNAuthenticator(object):
def _find_connection(self, common_name):
with open(OPENVPN_CONFIG, "r") as f:
for row in csv.reader(f, dialect="unix"):
# Skip empty rows
if not row:
# Skip empty rows or rows that are too short
if not row or len(row) < 5:
continue
# Skip disabled connections