Browse Source

修复ConfigForm不安全代码。链接分隔符支持空格。

tags/4.1.1
Soul Dark 7 years ago
parent
commit
22fdc823f2
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      shadowsocks-csharp/Model/Server.cs
  2. +1
    -1
      shadowsocks-csharp/View/ConfigForm.cs

+ 1
- 1
shadowsocks-csharp/Model/Server.cs View File

@@ -113,7 +113,7 @@ namespace Shadowsocks.Model
public static List<Server> GetServers(string ssURL) public static List<Server> GetServers(string ssURL)
{ {
var serverUrls = ssURL.Split('\r', '\n');
var serverUrls = ssURL.Split('\r', '\n', ' ');
List<Server> servers = new List<Server>(); List<Server> servers = new List<Server>();
foreach (string serverUrl in serverUrls) foreach (string serverUrl in serverUrls)


+ 1
- 1
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -228,7 +228,7 @@ namespace Shadowsocks.View
ServersListBox.SelectedIndex = _lastSelectedIndex; ServersListBox.SelectedIndex = _lastSelectedIndex;
return; return;
} }
if (_lastSelectedIndex >= 0)
if (_lastSelectedIndex >= 0 && _lastSelectedIndex < _modifiedConfiguration.configs.Count)
{ {
ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName(); ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName();
} }


Loading…
Cancel
Save