]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
openvpn-authenticator: Don't process configuration when row is too short
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 14 Jun 2022 15:53:19 +0000 (15:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 14 Jun 2022 15:53:19 +0000 (15:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/ovpn/openvpn-authenticator

index 67fb7208552c47857948c29ee1c11fe316339206..5773fb40b298d04aff8d265e8244c78ddd7f1628 100644 (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