When prefix is empty, this causes invalid memory read