Skip to content

Commit ec057e1

Browse files
committed
check tx index range
1 parent 80e805c commit ec057e1

File tree

1 file changed

+5
-0
lines changed
  • pkg/coordinator/tasks/tx_pool_latency_analysis

1 file changed

+5
-0
lines changed

pkg/coordinator/tasks/tx_pool_latency_analysis/task.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ func (t *Task) Execute(ctx context.Context) error {
228228
t.ctx.SetResult(types.TaskResultFailure)
229229
return
230230
}
231+
if tx_index < 0 || tx_index >= totNumberOfTxes {
232+
t.logger.Errorf("Transaction index out of range: %d", tx_index)
233+
t.ctx.SetResult(types.TaskResultFailure)
234+
return
235+
}
231236
latenciesMus[tx_index] = time.Since(txStartTime[tx_index]).Microseconds()
232237
receivedEvents++
233238

0 commit comments

Comments
 (0)