diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0e75e..ec032f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Changed - Explicitly allow TLS1.0 - Fix markdown output file format + - Fixed divide by 0 error when setting rate limit to 0 manually. - v2.0.0 - New diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4ae7b2c..c728da4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,6 +14,7 @@ * [Daviey](https://github.com/Daviey) * [delic](https://github.com/delic) * [denandz](https://github.com/denandz) +* [Ephex2](https://github.com/Ephex2) * [erbbysam](https://github.com/erbbysam) * [eur0pa](https://github.com/eur0pa) * [fabiobauer](https://github.com/fabiobauer) @@ -47,4 +48,3 @@ * [SolomonSklash](https://github.com/SolomonSklash) * [TomNomNom](https://github.com/tomnomnom) * [xfgusta](https://github.com/xfgusta) - diff --git a/pkg/ffuf/rate.go b/pkg/ffuf/rate.go index 48a6940..e8a0f50 100644 --- a/pkg/ffuf/rate.go +++ b/pkg/ffuf/rate.go @@ -65,7 +65,12 @@ func (r *RateThrottle) CurrentRate() int64 { } func (r *RateThrottle) ChangeRate(rate int) { - ratemicros := 1000000 / rate + ratemicros := 0 // set default to 0, avoids integer divide by 0 error + + if rate != 0 { + ratemicros = 1000000 / rate + } + r.RateLimiter.Stop() r.RateLimiter = time.NewTicker(time.Microsecond * time.Duration(ratemicros)) r.Config.Rate = int64(rate)