mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 10:12:50 +00:00
Fix potential crash when parsing broken Surge subscription
Optimize codes.
This commit is contained in:
2 files changed
+4
-2
No files matched your search
+1
-1
@@ -2430,7 +2430,7 @@ int simpleGenerator()
|
|||||||
{
|
{
|
||||||
if(y.first == "Subscription-UserInfo")
|
if(y.first == "Subscription-UserInfo")
|
||||||
{
|
{
|
||||||
std::cerr<<"User Info for artifact '"<<x<<"': "<<subInfoToMessage(y.second)<<"\n";
|
writeLog(0, "User Info for artifact '" + x + "': " + subInfoToMessage(y.second), LOG_LEVEL_INFO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1333,7 +1333,7 @@ bool explodeSurge(std::string surge, const std::string &custom_port, std::vector
|
|||||||
*/
|
*/
|
||||||
regGetMatch(x.second, proxystr, 3, NULL, &remarks, &config);
|
regGetMatch(x.second, proxystr, 3, NULL, &remarks, &config);
|
||||||
configs = split(config, ",");
|
configs = split(config, ",");
|
||||||
if(configs.size() < 2)
|
if(configs.size() < 3)
|
||||||
continue;
|
continue;
|
||||||
switch(hash_(configs[0]))
|
switch(hash_(configs[0]))
|
||||||
{
|
{
|
||||||
@@ -1358,6 +1358,8 @@ bool explodeSurge(std::string surge, const std::string &custom_port, std::vector
|
|||||||
|
|
||||||
//if(mod_md5 == modSSMD5) //is SSEncrypt module
|
//if(mod_md5 == modSSMD5) //is SSEncrypt module
|
||||||
{
|
{
|
||||||
|
if(configs.size() < 5)
|
||||||
|
continue;
|
||||||
server = trim(configs[1]);
|
server = trim(configs[1]);
|
||||||
port = custom_port.empty() ? trim(configs[2]) : custom_port;
|
port = custom_port.empty() ? trim(configs[2]) : custom_port;
|
||||||
if(port == "0")
|
if(port == "0")
|
||||||
|
|||||||
Reference in new issue
Block a user