pgpool2.git / summary / log / commit / refs

commit    3bb341eeec0d887c81c59f0af85f652d72c35c40
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sat Nov 02 02:42:52 2013 +0000

    Fix to check return status of pool_read().
    
    Per Coverity report "1111374 Unchecked return value.


src/utils/pool_ssl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/pool_ssl.c b/src/utils/pool_ssl.c index 64f288048..0bdeaf5b6 100644 --- a/src/utils/pool_ssl.c +++ b/src/utils/pool_ssl.c @@ -5,7 +5,7 @@ * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * - * Copyright (c) 2003-2012 PgPool Global Development Group + * Copyright (c) 2003-2013 PgPool Global Development Group * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby @@ -73,7 +73,13 @@ void pool_ssl_negotiate_clientserver(POOL_CONNECTION *cp) { pool_debug("pool_ssl: sending client->server SSL request"); pool_write_and_flush(cp, ssl_packet, sizeof(int)*2); - pool_read(cp, &server_response, 1); + + if (pool_read(cp, &server_response, 1) < 0) + { + pool_error("pool_ssl_negotiate_clientserver: pool_read failed"); + return; + } + pool_debug("pool_ssl: client->server SSL response: %c", server_response); switch (server_response) { [parent: 8d1e8dce1297]