[pgpool-committers: 653] pgpool: Fix segfault reported in bugtrack #21. When memqcache enabled

Tatsuo Ishii ishii at postgresql.org
Mon Oct 1 11:49:59 JST 2012


Fix segfault reported in bugtrack #21.  When memqcache enabled and
extended protocol is used, do_query() accesses system catalog and use
pool_read2(). Unfortunately parse message packet is given to Parse()
and the packet contents is on pool_read2's buffer. Thus do_query could
break the packet contents, and it leads to segfault. Solution is,
allocate memory and copies the packet contents and pass to
Parse(). Note that query context holds query string, which is in the
packet as well. So we need to copy it and save the pointer in the
query context.

I think the problem is not only with Parse() but with other protocol
modules. So this fix is not Parse() only, rather for other
modules. For this purpose ProcessFrontendResponse() is changed.

Branch
------
master

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

Modified Files
--------------
pool_proto_modules.c |   25 +++++++++++++++++++++----
pool_query_context.c |    2 +-
2 files changed, 22 insertions(+), 5 deletions(-)



More information about the pgpool-committers mailing list