!1308 修复pg_recvlogical工具校验逻辑复制槽名称长度时候,未考虑双引号,在边界条件校验失败

Merge pull request !1308 from zhangxubo/bugfix
This commit is contained in:
opengauss-bot
2022-02-11 01:44:18 +00:00
committed by Gitee

View File

@ -1885,6 +1885,7 @@ static bool cmdStringLengthCheck(const char* cmd_string)
{
const size_t cmd_length_limit = 1024;
const size_t slotname_limit = 64;
const size_t double_quotes_len = 2;
char comd[cmd_length_limit] = {'\0'};
char* sub_cmd = NULL;
char* rm_cmd = NULL;
@ -1934,7 +1935,7 @@ static bool cmdStringLengthCheck(const char* cmd_string)
return true;
}
if (strlen(slot_name) >= slotname_limit) {
if (strlen(slot_name) >= slotname_limit + double_quotes_len) {
return false;
}
return true;