Fix response buffer pointer advancement in do_error_execute_command

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: "pgpool-hackers(at)lists(dot)postgresql(dot)org" <pgpool-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix response buffer pointer advancement in do_error_execute_command
Date: 2026-09-10 07:56:35
Message-ID: OS9P286MB6486821B656397FBCD72BE5394BF2@OS9P286MB6486.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

Hi,
Please find attached a patch fixing the response buffer pointer advancement in do_error_execute_command().
After copying len bytes of the response body, the code advances the buffer pointer by sizeof(len) instead of len. In particular, a zero-length response body still advances the pointer, causing subsequent saved responses to be corrupted.
This patch changes p += sizeof(len) to p += len in both the protocol v2 and v3 paths.
I propose backpatching this fix through v4.3.
Could you please review the attached patch?
Best regards,
Taiki Koshino

Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment Content-Type Size
v1-0001-Fix-response-buffer-pointer-advancement-in-do_err.patch application/octet-stream 1.4 KB

Browse pgpool-hackers by date

  From Date Subject
Previous Message Roy, Dibyandu 2026-09-10 03:06:15 Re: Proposal: PCP command for watchdog leader switchover (TODO: "Pgpool-II leader node switchover")