From b600fe4f82e29c8cdf0e19594549d2a647d41d7b Mon Sep 17 00:00:00 2001 From: yuchao Date: Thu, 8 Feb 2024 11:02:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=BC=E5=AE=B9b=E5=BA=93?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=88=9B=E5=BB=BA=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=97=B6core=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/pl/plpgsql/src/pl_scanner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/pl/plpgsql/src/pl_scanner.cpp b/src/common/pl/plpgsql/src/pl_scanner.cpp index 4a817411b..4b06f71a8 100644 --- a/src/common/pl/plpgsql/src/pl_scanner.cpp +++ b/src/common/pl/plpgsql/src/pl_scanner.cpp @@ -377,6 +377,8 @@ static int internal_yylex(TokenAuxData* auxdata) int token; const char* yytext = NULL; + errno_t rc = memset_s(auxdata, sizeof(TokenAuxData), 0, sizeof(TokenAuxData)); + securec_check(rc, "\0", "\0"); Assert(u_sess->plsql_cxt.curr_compile_context); PLpgSQL_compile_context* curr_compile = u_sess->plsql_cxt.curr_compile_context; if (curr_compile->num_pushbacks > 0) { @@ -1045,7 +1047,7 @@ static int plpgsql_parse_declare(int* loc) int tok3 = -1; tok2 = internal_yylex(&aux2); tok3 = internal_yylex(&aux3); - if (tok3 != IDENT) { + if (tok3 != IDENT || aux3.lval.str == NULL) { push_back_token(tok3, &aux3); push_back_token(tok2, &aux2); push_back_token(tok1, &aux1);