bugfix:修复HTTP请求中没有HOST时,未判空导致coredump

This commit is contained in:
fengweihao
2023-05-31 19:16:21 +08:00
parent 5af89ccc93
commit 6574566276
2 changed files with 10 additions and 5 deletions

View File

@@ -772,7 +772,7 @@ void policy_action_param_dup(int idx, void **to, void **from, long argl, void *a
void ma_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
{
int ret=0, profile_id=0, is_valid=0;
char profile_name[128]={0}, formate[128]={0};
char profile_name[256]={0}, formate[128]={0};
char profile_path[TFE_PATH_MAX]={0};
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, &is_valid);
@@ -812,7 +812,7 @@ void ma_profile_table_new_cb(const char *table_name, int table_id, const char* k
void ma_insert_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
{
int ret=0, profile_id=0, is_valid=0;
char profile_name[128]={0}, formate[128]={0};
char profile_name[256]={0}, formate[128]={0};
char profile_path[TFE_PATH_MAX]={0},profile_position[TFE_PATH_MAX]={0};
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, profile_position, &is_valid);
@@ -852,7 +852,7 @@ void ma_insert_profile_table_new_cb(const char *table_name, int table_id, const
void ma_hijack_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
{
int ret=0, profile_id=0, is_valid=0;
char profile_name[128]={0}, formate[128]={0};
char profile_name[256]={0}, formate[128]={0};
char profile_path[TFE_PATH_MAX]={0},hijack_name[128]={0};
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, hijack_name, formate, profile_path, &is_valid);