From 990583a70210eb16de87a6c129592db6d8b6776a 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 cdeaa0328..a17475ea2 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -5225,10 +5225,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); }