From fbde87d2d074ef4e4d610a871c78c464f8119785 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)