From 5b5e8c79e079796e1fcd4c5f266e9902552f5f3a Mon Sep 17 00:00:00 2001 From: ivorget Date: Tue, 28 Jul 2026 17:02:14 +0200 Subject: [PATCH] Update tarpit.go for 32-bit architectures Defer conversion to int until after the calculation to avoid overflow on 32-bit architectures. --- tarpit/tarpit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarpit/tarpit.go b/tarpit/tarpit.go index c701c48..635aaba 100644 --- a/tarpit/tarpit.go +++ b/tarpit/tarpit.go @@ -31,7 +31,7 @@ func New(workers int, contentType string, period, timeslice time.Duration, minRe t := &Tarpit{ contentType: contentType, - numTimeslices: (int(period) + int(timeslice) - 1) / int(timeslice), + numTimeslices: int((period + timeslice - 1) / timeslice), timeslice: timeslice, minResponseLen: minResponseLen, maxResponseLen: maxResponseLen,