From 09cac7256b2c33b5a86119ffc7a956d2c05a299e Mon Sep 17 00:00:00 2001 From: Lu Qiuwen Date: Wed, 24 Oct 2018 20:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3HTTP-Block=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8Ccontent=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=BC=95=E8=B5=B7=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=A0=A1=E9=AA=8C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/pangu-http/src/pangu_http.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index 9d3f464..a1ef650 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -729,11 +729,12 @@ static void http_reject(const struct tfe_http_session * session, enum tfe_http_e size_t page_size = 0; char cont_len_str[16]; - char msg[TFE_STRING_MAX]; + + char msg[TFE_STRING_MAX] = ""; struct tfe_http_session * to_write_sess = NULL; ret = sscanf(ctx->enforce_para, "code=%d;content=%[^\n]", &resp_code, msg); - if (ret != 2) + if (ret != 1 && ret != 2) { TFE_LOG_ERROR(g_pangu_rt->local_logger, "Invalid reject rule %d paramter %s", ctx->enforce_rules[0].config_id, ctx->enforce_para);