From 7302884f891ebee85a7169645137c77652561719 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 be6f2abed..544e212da 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -5212,10 +5212,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