projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
371550f
)
Fix the failover() so that it does not access out of array.
author
Tatsuo Ishii
<ishii@sraoss.co.jp>
Wed, 17 Jul 2019 07:51:31 +0000
(16:51 +0900)
committer
Tatsuo Ishii
<ishii@sraoss.co.jp>
Fri, 19 Jul 2019 07:45:11 +0000
(16:45 +0900)
Per Coverity.
src/main/pgpool_main.c
patch
|
blob
|
blame
|
history
diff --git
a/src/main/pgpool_main.c
b/src/main/pgpool_main.c
index 3e0fe52f211570af33097c10717913cf74797faf..15d273949a4d51b99a4ff9f540b0bc16633d0fef 100644
(file)
--- a/
src/main/pgpool_main.c
+++ b/
src/main/pgpool_main.c
@@
-1783,6
+1783,7
@@
static void 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))))