From 15a44d04c077c0efff88fec75c076aae6dcaa1a7 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sat, 14 Sep 2024 22:41:30 +0900 Subject: [PATCH] Fix pool_push_pending_data(). Fix "insecure data handling". Per Coverity (CID 1559731) --- src/protocol/pool_process_query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol/pool_process_query.c b/src/protocol/pool_process_query.c index 575b61e40..8768f4a92 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -5183,10 +5183,10 @@ pool_push_pending_data(POOL_CONNECTION * backend) len_save = len; len = ntohl(len); + len -= sizeof(len); buf = NULL; - if ((len - sizeof(len)) > 0) + if (len > 0) { - len -= sizeof(len); buf = palloc(len); pool_read(backend, buf, len); } -- 2.39.5