[pgpool-committers: 6783] pgpool: Fix segmentation fault when application name is included in log

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jun 4 11:33:13 JST 2020


Fix segmentation fault when application name is included in log_line_prefix.

In Pgpool-II 4.1 or before log_line_prefix unconditionally tried to
fetch the application name from backend info (slots array).
Unfortunately in certain corner cases this was not possible. When
connection_cache is off, pgpool resets connection slots
(session->backend->slots[]) at the time when clients sends termination
request to pgpool. If log_min_messages is DEBUG5, pgpool wants to emit
this log message:

     DEBUG: RESET ALL CONFIG VARIABLE

which caused a segfault because pgpool tried to refer NULL pointer.
Fix is, if session->backend->slots[] is NULL, do not try to fetch
application name from the variable.

Per bug 615.

Branch
------
V4_0_STABLE

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

Modified Files
--------------
src/utils/error/elog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list