[pgpool-committers: 2675] pgpool: Fix ancient bug of pool_push() and friends.

Tatsuo Ishii ishii at postgresql.org
Thu Sep 3 11:00:47 JST 2015


Fix ancient bug of pool_push() and friends.

It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later. It is surprising
that this bug was not found earlier because the bug was there since
the function was added. This is probably due to the fact that actual
pointer moving does not happen until certain amount of memory.

Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.

Branch
------
V3_4_STABLE

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

Modified Files
--------------
src/utils/pool_stream.c |   10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)



More information about the pgpool-committers mailing list