From b9f18a69fa1bcdd8b6a95fb11d85d14eb22cc6ba Mon Sep 17 00:00:00 2001 From: vastdata-xyzr Date: Tue, 12 Sep 2023 10:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8securec=5Fcheck=E5=B8=A6=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/error/elog.cpp | 2 +- src/include/utils/elog.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/backend/utils/error/elog.cpp b/src/common/backend/utils/error/elog.cpp index 22454bfc2..30f36c04c 100644 --- a/src/common/backend/utils/error/elog.cpp +++ b/src/common/backend/utils/error/elog.cpp @@ -5700,7 +5700,7 @@ static void eraseSingleQuotes(char* query_string) * Report error according to the return value. * At the same time, we should free the space alloced by developers. */ -void freeSecurityFuncSpace(char* charList, ...) +void freeSecurityFuncSpace(const char* charList, ...) { va_list argptr; diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index bc24df861..2e1651374 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -315,7 +315,7 @@ typedef struct FormatCallStack { #define securec_check(errno, charList, ...) \ { \ if (EOK != errno) { \ - freeSecurityFuncSpace(static_cast(charList), ##__VA_ARGS__); \ + freeSecurityFuncSpace(charList, ##__VA_ARGS__); \ switch (errno) { \ case EINVAL: \ elog(ERROR, \ @@ -668,7 +668,7 @@ extern void write_stderr_with_prefix(const char* fmt, ...) extern void getElevelAndSqlstate(int* eLevel, int* sqlState); extern void get_time_now(char* nowTime, int timeLen); -void freeSecurityFuncSpace(char* charList, ...); +void freeSecurityFuncSpace(const char* charList, ...); extern void SimpleLogToServer(int elevel, bool silent, const char* fmt, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));