[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [networkmanagement/nm09] /: Ideally, SECRET_TAG and TLS_AUTH_TAG should contain 2 parameters, second
From:       Lamarque V. Souza <lamarque () kde ! org>
Date:       2012-09-30 21:51:03
Message-ID: 20120930215103.416A5A6096 () git ! kde ! org
[Download RAW message or body]

Git commit ee89543910d3a879be21bf32b525cba95b3d7b85 by Lamarque V. Souza, on behalf \
of Rajeesh K Nambiar. Committed on 30/09/2012 at 23:48.
Pushed by lvsouza into branch 'nm09'.

Ideally, SECRET_TAG and TLS_AUTH_TAG should contain 2 parameters, second
one being the direction (in/out) assuming values 0 or 1 respectively.
Added another check to ensure that the 2nd parameter is present before
accessing that index.

BUG: 307517
FIXED-IN: 0.9.0.5

M  +1    -1    plasma_nm_version.h
M  +10   -6    vpnplugins/openvpn/openvpn.cpp

http://commits.kde.org/networkmanagement/ee89543910d3a879be21bf32b525cba95b3d7b85

diff --git a/plasma_nm_version.h b/plasma_nm_version.h
index aa2eed6..89c8285 100644
--- a/plasma_nm_version.h
+++ b/plasma_nm_version.h
@@ -1,4 +1,4 @@
 #ifndef PLASMA_NM_VERSION_H
 #define PLASMA_NM_VERSION_H
-static const char * plasmaNmVersion = "0.9.0.4 (nm09 20120925)";
+static const char * plasmaNmVersion = "0.9.0.4 (nm09 20120930)";
 #endif
diff --git a/vpnplugins/openvpn/openvpn.cpp b/vpnplugins/openvpn/openvpn.cpp
index 6b67880..27fa650 100644
--- a/vpnplugins/openvpn/openvpn.cpp
+++ b/vpnplugins/openvpn/openvpn.cpp
@@ -386,18 +386,22 @@ QVariantList OpenVpnUiPlugin::importConnectionSettings(const \
QString &fileName)  if (key_value[0] == SECRET_TAG && key_value.count() > 1) {
             key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); \
                // Get whole string after key
             dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY), \
                unQuote(key_value[1], fileName));
-            key_value[2] = key_value[1];
-            if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 \
                ||key_value[2].toLong() == 1))
-                dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY_DIRECTION), \
key_value[2]); +            if (key_value.count() > 2) {
+                key_value[2] = key_value[1];
+                if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 \
||key_value[2].toLong() == 1)) +                    \
dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY_DIRECTION), key_value[2]); +   \
}  have_sk = true;
             continue;
         }
         if (key_value[0] == TLS_AUTH_TAG && key_value.count() >1) {
             key_value[1] = line.right(line.length() - line.indexOf(QRegExp("\\s"))); \
                // Get whole string after key
             dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA), unQuote(key_value[1], \
                fileName));
-            key_value[2] = key_value[1];
-            if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 \
                ||key_value[2].toLong() == 1))
-                dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA_DIR), key_value[2]);
+            if (key_value.count() > 2) {
+                key_value[2] = key_value[1];
+                if (!key_value[2].isEmpty() && (key_value[2].toLong() == 0 \
||key_value[2].toLong() == 1)) +                    \
dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA_DIR), key_value[2]); +            }
             continue;
         }
         if (key_value[0] == CIPHER_TAG) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic