From 0880a3e1b42e8bd40babf1c7ea2ddf45dfb1f5af Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Fri, 19 Jan 2018 14:06:09 +0200 Subject: [PATCH] Allocate enough space for transaction nodes This fix prevents any potential memory access that might occur while forming the deadlock path. --- .../distributed/transaction/distributed_deadlock_detection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/distributed/transaction/distributed_deadlock_detection.c b/src/backend/distributed/transaction/distributed_deadlock_detection.c index 0bf60c58d..a2d847964 100644 --- a/src/backend/distributed/transaction/distributed_deadlock_detection.c +++ b/src/backend/distributed/transaction/distributed_deadlock_detection.c @@ -134,7 +134,7 @@ CheckForDistributedDeadlocks(void) { bool deadlockFound = false; List *deadlockPath = NIL; - TransactionNode *transactionNodeStack[edgeCount]; + TransactionNode *transactionNodeStack[edgeCount + 1]; /* we're only interested in finding deadlocks originating from this node */ if (transactionNode->transactionId.initiatorNodeIdentifier != localGroupId)