pgpool2.git / summary / log / commit / refs
commit 646c1eba2b38a4d4577fee0a956451ca55b38729
Author: Nozomi Anzai <anzai@sraoss.co.jp>
Date: Mon Dec 17 04:17:50 2012 +0000
Fix read_startup_packet() to reset alarm and free StartupPacket
when pool_read() returns 0 which means incorrect packet length.
child.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/child.c b/child.c
index 359b1c0a8..16b1615f5 100644
--- a/child.c
+++ b/child.c
@@ -834,6 +834,10 @@ static StartupPacket *read_startup_packet(POOL_CONNECTION *cp)
/* read startup packet length */
if (pool_read(cp, &len, sizeof(len)))
{
+ pool_error("read_startup_packet: incorrect packet length (%d)", len);
+ pool_free_startup_packet(sp);
+ alarm(0);
+ pool_signal(SIGALRM, SIG_IGN);
return NULL;
}
len = ntohl(len);
[parent: 452b9b7c52f9]