avoid trying to parse zero length buffer