catch buffer overrun in edge case