pgpool2.git / summary / log / commit / refs
commit a4d217a9976ba016005dc30e6177f8f0ecdee0cb
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Wed Jul 17 07:51:31 2019 +0000
Fix the failover() so that it does not access out of array.
Per Coverity.
src/main/pgpool_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index cbf18c2b6..bdf10109d 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -2139,6 +2139,7 @@ failover(void)
{
/* only if the failover is against the current primary */
if (((reqkind == NODE_DOWN_REQUEST) &&
+ Req_info->primary_node_id >= 0 &&
(nodes[Req_info->primary_node_id])) ||
(node_id >= 0 && (reqkind == PROMOTE_NODE_REQUEST) &&
(VALID_BACKEND(node_id))))
[parent: a5514632bc7b]