Skip to content

Commit 3e113c0

Browse files
committed
fix(sdk-coin-sol): check array bounds for transaction type matching
Ticket: SC-2760
1 parent b4ac52b commit 3e113c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/sdk-coin-sol/src/lib/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ export function matchTransactionTypeByInstructionsOrder(
282282

283283
// Check instructions by order using the index.
284284
for (const keyName of instructionsKeys) {
285-
const result = getInstructionType(instructionsCopy[instructionIndexes[keyName]]);
285+
const index = instructionIndexes[keyName];
286+
if (index >= instructionsCopy.length) {
287+
return false;
288+
}
289+
const result = getInstructionType(instructionsCopy[index]);
286290
if (result !== keyName) {
287291
return false;
288292
}

0 commit comments

Comments
 (0)