[pgpool-committers: 841] pgpool: Fix long standing bug with timestamp rewriting code for process

Tatsuo Ishii ishii at postgresql.org
Mon Mar 18 16:14:39 JST 2013


Fix long standing bug with timestamp rewriting code for processing
extended protocol.

Parse() allocate memory using palloc() while rewriting the parse
message.  Problem is, the rewritten message was kept in the data which
is managed by pool_create_sent_message() etc. The function assumes
that all the data is in session context memory. However, palloc()
allocates memory in query context of course, and gets freeed later on
when the query context disappears. And the function tries to free the
memory as well, which causes various problems, including segfault and
double free. To fix this, memory to store rewritten message is
allocated using session context. The bug was there since pgpool-II 3.0
was born.

Problem analysis and patch contributed by Naoya Anzai.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=44f4faf273de7ec88fce8e5e7b1e91f55e114bd2

Modified Files
--------------
pool_proto_modules.c |    3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)



More information about the pgpool-committers mailing list