[pgpool-committers: 4853] pgpool: Fix accessing already freed data in extended query.

Tatsuo Ishii ishii at postgresql.org
Fri Jul 13 17:45:01 JST 2018


Fix accessing already freed data in extended query.

When previous_message was set and accessed later on, it looked into
already freed data. This is because read_kind_from_backend() set the
pointer to the previous message in session context, and then released
the memory at the end of the function. No report from fields so far. I
just found this while testing Pgpool-II.

To fix this, store the previous message in the session context, rather
than storing the pointer. Also have a flag in the session context to
indicate whether a previous message is actually stored or not.

All the API for previous message has not been changed.

Branch
------
V3_5_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=454518504c9be10fd000fb502be67e8ad1710105

Modified Files
--------------
src/context/pool_session_context.c         | 13 +++++++++----
src/include/context/pool_session_context.h |  7 +++++--
2 files changed, 14 insertions(+), 6 deletions(-)



More information about the pgpool-committers mailing list