projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee8556e
)
Fix possible out of array index access.
author
Tatsuo Ishii
<ishii@sraoss.co.jp>
Sun, 7 Jul 2019 13:58:35 +0000
(22:58 +0900)
committer
Tatsuo Ishii
<ishii@sraoss.co.jp>
Sun, 7 Jul 2019 14:00:33 +0000
(23:00 +0900)
It was pointed out by Coverity that node_id could be -1.
src/main/pgpool_main.c
patch
|
blob
|
blame
|
history
diff --git
a/src/main/pgpool_main.c
b/src/main/pgpool_main.c
index 0b8742c36cb8f187b4e1f8de877a6972d3243c6b..f7591da2006da0de51bcf4361e2613fb389820f3 100644
(file)
--- a/
src/main/pgpool_main.c
+++ b/
src/main/pgpool_main.c
@@
-2026,7
+2026,7
@@
static void failover(void)
/* only if the failover is against the current primary */
if (((reqkind == NODE_DOWN_REQUEST) &&
(nodes[Req_info->primary_node_id])) ||
- ((reqkind == PROMOTE_NODE_REQUEST) &&
+ (
node_id >= 0 &&
(reqkind == PROMOTE_NODE_REQUEST) &&
(VALID_BACKEND(node_id))))
{