Skip to content← All gravesR.I.P.
Array index -1
–
“Wrote where no one should write.”
C++Off-by-one
Death certificate
- Status
- 🪦 Buried
- Cause of death
- Off-by-oneLooped once too often, or once too few. A `<=` where a `<` belonged.
- Severity
- Critical
- Hours to kill
- 22 hours
- Killed by
- Jashanpreet
- Language
- C++
- Born
- 19 Jan 2026
- Fix merged
- 27 Jan 2026
- Buried
- 5 Feb 2026
- Component
- parser
- Symptoms
- The parser read index -1 on empty input and overwrote the memory next to the buffer.
- The fix
- Checked for empty input before reading the last element.
Timeline
Every life of this bug, oldest first.
- 🐛
Born as “Array index -1”19 Jan 2026
- 🩹
Fix merged27 Jan 2026
- 🪦
Buried5 Feb 2026