summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author刘学利 <[email protected]>2023-08-08 08:23:07 +0000
committer刘学利 <[email protected]>2023-08-08 08:23:07 +0000
commit9658ca2784958da8ee42c328dbd91a3df0fb3b4c (patch)
tree3affc945bb3277dd2409cdefa6684fa353d30faf /src
parent79ca2d2ac4150af89807928370e79a4d84a016f7 (diff)
TSG-16515: 单数据包多次扫描命中结果超16个时存在非法写导致段错误v6.1.1
Diffstat (limited to 'src')
-rw-r--r--src/tsg_action.cpp4
-rw-r--r--src/tsg_rule.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tsg_action.cpp b/src/tsg_action.cpp
index cd0c9f5..7c33051 100644
--- a/src/tsg_action.cpp
+++ b/src/tsg_action.cpp
@@ -228,7 +228,7 @@ static void template_generate(const struct streaminfo *a_stream, int status_code
static int get_response_pages(const struct streaminfo *a_stream, struct maat_rule *p_result, struct compile_user_region *user_region, char **payload, int thread_seq)
{
- int payload_len=0;
+ size_t payload_len=0;
switch(user_region->deny->type)
{
@@ -260,7 +260,7 @@ static int get_response_pages(const struct streaminfo *a_stream, struct maat_rul
}
}
- return payload_len;
+ return (int)payload_len;
}
static int set_tcp_rst_flags(char *packet, int ip_tcp_hdr_len)
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp
index 325f977..f2ec737 100644
--- a/src/tsg_rule.cpp
+++ b/src/tsg_rule.cpp
@@ -2209,7 +2209,7 @@ int srt_attribute_set_subscriber_id(const struct streaminfo *a_stream, struct ma
size_t matche_rules_convert(struct maat *feather,long long *rules, size_t n_rules, struct maat_rule *matched_rules, size_t n_matched_rules)
{
size_t offset=0;
- for(size_t i=0; i<n_rules && offset<n_rules; i++)
+ for(size_t i=0; i<n_rules && offset<n_matched_rules; i++)
{
struct maat_compile *maat_compile=(struct maat_compile *)maat_plugin_table_get_ex_data(feather, g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_SECURITY_COMPILE].id, (const char *)&(rules[i]), sizeof(long long));
if(maat_compile==NULL)