0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

Fixed iOS regression caused by addition of support for non-unified

profile merge, where profiles that succeeded in the merge phase
but failed in the options parse phase would crash the UI.
This commit is contained in:
James Yonan 2012-11-15 16:17:46 +00:00
parent 730b38703d
commit 5047d251a0
2 changed files with 8 additions and 5 deletions

View File

@ -37,7 +37,7 @@ namespace openvpn {
}
const char c = data[index++];
line += c;
if (c == '\n')
if (c == '\n' || index >= size)
{
if (trim)
string::trim_crlf(line);

View File

@ -128,8 +128,11 @@ namespace openvpn {
se.friendlyName = se.server;
Option::validate_string("HOST_LIST server", se.server, 256);
Option::validate_string("HOST_LIST friendly name", se.friendlyName, 256);
serverList_.push_back(se);
++count;
if (!se.server.empty() && !se.friendlyName.empty())
{
serverList_.push_back(se);
++count;
}
}
}
}
@ -137,7 +140,7 @@ namespace openvpn {
catch (const std::exception& e)
{
error_ = true;
message_ = e.what();
message_ = Unicode::utf8_printable(e.what(), 256);
}
}
@ -198,7 +201,7 @@ namespace openvpn {
{
ParseClientConfig ret;
ret.error_ = true;
ret.message_ = e.what();
ret.message_ = Unicode::utf8_printable(e.what(), 256);
return ret;
}
}