EventParser.parse throws OOM when end > is missing
Brought to you by:
justb
From Carsten:
Date: 18-06-14 12:15
We have stumbled over a bug in EventParser.parse that causes an OOM exception when the > char is missing.
The following code should check for -1 returned from read() and break/throw accordingly.
// Then find end-tag ('>'), appending all chars to preparsed string. do { nextChar = (char) aReader.read(); preparsedString.append(nextChar); } while (nextChar != '>');
This can/will happen if there is a difference between the char encoding used by the server (tomcat) hosting pushlet and the encoding of any strings contained in the events sent from a client.
Reproduced: the new version of parse should always check for -1 (EOF) for both open and close tags.