Prevent prefix checking from reading past allocated memory.