Fix uninitialized memory error.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 3 Apr 2024 10:13:53 +0000 (19:13 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 3 Apr 2024 10:23:20 +0000 (19:23 +0900)
commit554b7ad9186fe2b465d305f300294c8af4c11916
tree7ae6bb8d6a608970a5837827ef3b764e437d7469
parentca3ecfd7ae8c63f3b8c6f7fa78ace36c4ffc10c5
Fix uninitialized memory error.

It was reported that valgrind found several errors including an
uninitialized memory error in read_startup_packet. It allocates memory
for user name in a startup packet in case cancel or SSL request using
palloc, and later on the memory is used by pstrdup. Since memory
allocated by palloc is undefined, this should have been palloc0.

Bug reported by: Emond Papegaaij
Backpatch-through: v4.1
Discussion:
[pgpool-general: 9065] Re: Segmentation after switchover
https://www.pgpool.net/pipermail/pgpool-general/2024-April/009126.html
src/protocol/child.c