[pgpool-committers: 2676] 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_2_STABLE

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

Modified Files
--------------
pool_stream.c |    8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)



More information about the pgpool-committers mailing list