pgpool2.git / summary / log / commit / refs

commit    9f1acea4e6b1b4889f0640d0517e4f46de32b60a
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Wed Aug 16 04:40:46 2017 +0000

    Fix core dump and mishandling of temp tables.
    
    Fix two issues:
    
    1) Protect pool_remove_sent_message() and pool_get_sent_message()
       against null parameters.
    
    2) Fix bug while determining if the created table is temporary or not.


src/context/pool_session_context.c | 6 ++++++ src/protocol/pool_proto_modules.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/context/pool_session_context.c b/src/context/pool_session_context.c index c651fcdea..2e93985a6 100644 --- a/src/context/pool_session_context.c +++ b/src/context/pool_session_context.c @@ -346,6 +346,9 @@ bool pool_remove_sent_message(char kind, const char *name) int i; POOL_SENT_MESSAGE_LIST *msglist; + if (kind == 0 || name == NULL) + return false; + msglist = &pool_get_session_context(false)->message_list; for (i = 0; i < msglist->size; i++) @@ -574,6 +577,9 @@ POOL_SENT_MESSAGE *pool_get_sent_message(char kind, const char *name, POOL_SENT_ msglist = &pool_get_session_context(false)->message_list; + if (kind == 0 || name == NULL) + return NULL; + for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->kind == kind && diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index aaf75fccf..d02955646 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -3726,7 +3726,7 @@ void pool_at_command_success(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *ba if (IsA(node, CreateStmt)) { CreateStmt *create_table_stmt = (CreateStmt *)node; - if (create_table_stmt->relation->relpersistence) + if (create_table_stmt->relation->relpersistence == 't') discard_temp_table_relcache(); } } [parent: 32a451a512ba]