summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2021-11-03 18:01:57 +0800
committerfengweihao <[email protected]>2021-11-03 18:01:57 +0800
commitb081271a88090d4e15f21a10bb1f39175eed0f69 (patch)
treea46c12302d163b82f7a9abaf104245f993f385e6
parent59d4f2ee9997b1c799cc3b740aff1ff56f3e867b (diff)
bugfix: TSG-8293 用户自定义请求头缺省关键字段导致重启v2.2.7-20211103
-rw-r--r--scan/src/policy_scan.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scan/src/policy_scan.cpp b/scan/src/policy_scan.cpp
index a7d30cc..9d02e6f 100644
--- a/scan/src/policy_scan.cpp
+++ b/scan/src/policy_scan.cpp
@@ -1104,7 +1104,7 @@ size_t verify_policy_scan(enum verify_policy_type policy_type, struct verify_pol
if ((protocol_field == PXY_CTRL_HTTP_REQ_HDR) || protocol_field == PXY_CTRL_HTTP_RES_HDR)
{
- if(query_obj->district != NULL)
+ if(query_obj->district != NULL && value != NULL)
{
const char * str_field_name = query_obj->district;
scan_ret = Maat_set_scan_status(g_pangu_rt->maat[policy_type], &(ctx->scan_mid), MAAT_SET_SCAN_DISTRICT,
@@ -1121,6 +1121,7 @@ size_t verify_policy_scan(enum verify_policy_type policy_type, struct verify_pol
query_obj->nth_scan[0] = ctx->hit_path[ctx->n_read].Nth_scan;
ctx->n_read=n_read;
}
+ goto decide;
}
if(policy_type == PXY_TABLE_SECURITY &&(protocol_field == PXY_SECURITY_HTTPS_SNI || protocol_field == PXY_SECURITY_HTTP_FQDN))