summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii2024-09-14 13:41:30 +0000
committerTatsuo Ishii2024-09-14 13:41:30 +0000
commit990583a70210eb16de87a6c129592db6d8b6776a (patch)
treed1b7de32680ef7334cfd45599e7179fd0859692a
parent400490dd3b23e19614fd90a10c0749f15f61a2d7 (diff)
Fix pool_push_pending_data().
Fix "insecure data handling". Per Coverity (CID 1559731)
-rw-r--r--src/protocol/pool_process_query.c4
1 files 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);
}