From 3aa737e7eb0d587d365fa7e430e4ce8507d71fc5 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Tue, 28 Oct 2025 23:40:25 +0800 Subject: [PATCH 1/3] Update RouteEntity.cpp --- src/dataStore/RouteEntity.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dataStore/RouteEntity.cpp b/src/dataStore/RouteEntity.cpp index 3f08ed3..252cf08 100644 --- a/src/dataStore/RouteEntity.cpp +++ b/src/dataStore/RouteEntity.cpp @@ -785,17 +785,17 @@ namespace Configs { bool RoutingChain::add_simple_process_rule(const QString& content, const std::shared_ptr& rule, ruleType type) { auto sp = content.split(":"); - if (sp.size() != 2) return false; - const QString& address = sp[1]; const QString& subType = sp[0]; - if (subType == "processName" && type == simpleProcessName) - { - if (!rule->process_name.contains(address)) rule->process_name.append(address); - return true; - } else if (subType == "processPath" && type == simpleProcessPath) + if (subType == "processPath" && type == simpleProcessPath) { + const QString& address = content.section(':', 0); if (!rule->process_path.contains(address)) rule->process_path.append(address); return true; + } else if (subType == "processName" && type == simpleProcessName && sp.size() == 2) + { + const QString& address = sp[1]; + if (!rule->process_name.contains(address)) rule->process_name.append(address); + return true; } else { return false; From 645f7c3d60e01b4e1f8718b02ddda5819dabe8a2 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Wed, 29 Oct 2025 00:09:32 +0800 Subject: [PATCH 2/3] Update RouteEntity.cpp --- src/dataStore/RouteEntity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dataStore/RouteEntity.cpp b/src/dataStore/RouteEntity.cpp index 252cf08..839c79e 100644 --- a/src/dataStore/RouteEntity.cpp +++ b/src/dataStore/RouteEntity.cpp @@ -788,7 +788,7 @@ namespace Configs { const QString& subType = sp[0]; if (subType == "processPath" && type == simpleProcessPath) { - const QString& address = content.section(':', 0); + const QString& address = content.section(':', 1); if (!rule->process_path.contains(address)) rule->process_path.append(address); return true; } else if (subType == "processName" && type == simpleProcessName && sp.size() == 2) From 6bb16476555d502874e8dda6bc636f2e1237c95e Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Wed, 29 Oct 2025 00:27:02 +0800 Subject: [PATCH 3/3] fix --- src/dataStore/RouteEntity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dataStore/RouteEntity.cpp b/src/dataStore/RouteEntity.cpp index 839c79e..788abcb 100644 --- a/src/dataStore/RouteEntity.cpp +++ b/src/dataStore/RouteEntity.cpp @@ -785,6 +785,7 @@ namespace Configs { bool RoutingChain::add_simple_process_rule(const QString& content, const std::shared_ptr& rule, ruleType type) { auto sp = content.split(":"); + if (sp.size() < 2) return false; const QString& subType = sp[0]; if (subType == "processPath" && type == simpleProcessPath) {