Git commit 0541202a63d1dc03314e06caa69dc796469c3e86 by Lamarque V. Souza, o= n behalf of Rajeesh K Nambiar. Committed on 30/09/2012 at 23:47. Pushed by lvsouza into branch 'master'. 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/0541202a63d1dc03314e06caa69dc79646= 9c3e86 diff --git a/plasma_nm_version.h b/plasma_nm_version.h index 2020bcd..f74b286 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 =3D "0.9.1_rc1 (master 20120925)"; +static const char * plasmaNmVersion =3D "0.9.1_rc1 (master 20120930)"; #endif diff --git a/vpnplugins/openvpn/openvpn.cpp b/vpnplugins/openvpn/openvpn.cpp index 1a71a09..993db15 100644 --- a/vpnplugins/openvpn/openvpn.cpp +++ b/vpnplugins/openvpn/openvpn.cpp @@ -385,18 +385,22 @@ QVariantList OpenVpnUiPlugin::importConnectionSetting= s(const QString &fileName) if (key_value[0] =3D=3D SECRET_TAG && key_value.count() > 1) { key_value[1] =3D line.right(line.length() - line.indexOf(QRegE= xp("\\s"))); // Get whole string after key dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY), unQuo= te(key_value[1], fileName)); - key_value[2] =3D key_value[1]; - if (!key_value[2].isEmpty() && (key_value[2].toLong() =3D=3D 0= ||key_value[2].toLong() =3D=3D 1)) - dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY_DIR= ECTION), key_value[2]); + if (key_value.count() > 2) { + key_value[2] =3D key_value[1]; + if (!key_value[2].isEmpty() && (key_value[2].toLong() =3D= =3D 0 ||key_value[2].toLong() =3D=3D 1)) + dataMap.insert(QLatin1String(NM_OPENVPN_KEY_STATIC_KEY= _DIRECTION), key_value[2]); + } have_sk =3D true; continue; } if (key_value[0] =3D=3D TLS_AUTH_TAG && key_value.count() >1) { key_value[1] =3D line.right(line.length() - line.indexOf(QRegE= xp("\\s"))); // Get whole string after key dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA), unQuote(key_v= alue[1], fileName)); - key_value[2] =3D key_value[1]; - if (!key_value[2].isEmpty() && (key_value[2].toLong() =3D=3D 0= ||key_value[2].toLong() =3D=3D 1)) - dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA_DIR), key_v= alue[2]); + if (key_value.count() > 2) { + key_value[2] =3D key_value[1]; + if (!key_value[2].isEmpty() && (key_value[2].toLong() =3D= =3D 0 ||key_value[2].toLong() =3D=3D 1)) + dataMap.insert(QLatin1String(NM_OPENVPN_KEY_TA_DIR), k= ey_value[2]); + } continue; } if (key_value[0] =3D=3D CIPHER_TAG) {