off-by-one error
A loop that runs one pass too many or too few.
An off-by-one error is a boundary mistake, typically <= where < was meant, that makes a loop or range include or exclude one element too many.
Examples
for (int i = 0; i <= items.Length; i++)runs one pass too many, and the last pass throwsIndexOutOfRangeException.
See also