rspec/rules/S6680/common/fix/limits.adoc

9 lines
464 B
Plaintext

==== Set limits
Validate loop variable values to ensure they fall within the expected bounds.
If a value falls outside of these bounds, reject it as invalid or adjust it to
bring it within bounds. This guarantees that the loop will only iterate over
the expected number of elements or perform the expected number of iterations.
Do not assume that users will provide sensible values. Attackers intentionally
choose unusual values to cause the system to misbehave.