Menu

#12 EventParser.parse throws OOM when end > is missing

2.0.5
open
None
5
2014-06-20
2014-06-20
No

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.

Discussion

  • Just van den Broecke

    • Group: v1.0_(example) --> 2.0.5
     
  • Just van den Broecke

    Reproduced: the new version of parse should always check for -1 (EOF) for both open and close tags.

     

Log in to post a comment.