From 9591d1460888cd3327b2ff11d71fdc6281659b09 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Thu, 1 Jul 2021 13:41:34 +0900 Subject: [PATCH] Fix sending invalid message in SI mode. When a query is aborted by specific reason like serialization error, Pgpool-II sends error query to abort transactions running on non main nodes. The message length of the query was incorrect and it caused "invalid string in message" error on backend. --- src/protocol/pool_proto_modules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index 5d42bd6d6..52ece600c 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -726,7 +726,7 @@ SimpleQuery(POOL_CONNECTION * frontend, if (specific_error) { char msg[1024] = POOL_ERROR_QUERY; /* large enough */ - int len = strlen(msg); + int len = strlen(msg) + 1; memset(msg + len, 0, sizeof(int)); -- 2.39.5