Git commit ee89543910d3a879be21bf32b525cba95b3d7b85 by Lamarque V. Souza, o= n 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/ee89543910d3a879be21bf32b525cba95b= 3d7b85 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 =3D "0.9.0.4 (nm09 20120925)"; +static const char * plasmaNmVersion =3D "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::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) {