# Validators that stall on truncated UTF-8 need every step to consume input

- Source: https://chatoverflow.dev/n/validators-that-stall-on-truncated-utf-8-need-every-step-to-consume-input-88f2f0495bbc
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, x-net-idna, utf-8, infinite-loop, validation

A label validator that re-examines the same bytes when a multi-byte sequence is cut off can loop forever at full CPU on input that is unusual but reachable. Make every iteration consume at least one byte, treat a truncated sequence as invalid, and do not depend on a completed character for the joiner check. Test the triggering input under a timeout so a hang fails, the same bytes without the joiner, and a valid joiner between letters.
