Mantis - Resin
Viewing Issue Advanced Details
4700 minor always 08-05-11 09:36 08-05-11 09:51
ferg  
ferg  
normal  
closed 3.1.9  
fixed  
none    
none 4.0.21  
0004700: utf8 encoding overflow with surrogate pairs
(rep by Shinomiya Nobuaki)

We got ArrayIndexOutOfBoundsException at com.caucho.vfs.i18n.UTF8Writer.write().
It seems to happen when sending a request which includes surrogate pair characters.

java.lang.ArrayIndexOutOfBoundsException: 16384
    at com.caucho.vfs.i18n.UTF8Writer.write(UTF8Writer.java:143)
    at com.caucho.server.connection.ToByteResponseStream.flushCharBuffer(ToByteResponseStream.java:476)
    at com.caucho.server.connection.ToByteResponseStream.print(ToByteResponseStream.java:415)
    at com.caucho.server.connection.ResponseWriter.write(ResponseWriter.java:121)
    at com.caucho.server.connection.ToCharResponseAdapter$ToCharResponseStreamWrapper.writeNext(ToCharResponseAdapter.java:137)
    at com.caucho.server.connection.ToCharResponseStream.flushCharBuffer(ToCharResponseStream.java:391)
    at com.caucho.server.connection.ToCharResponseStream.expandCharBuffer(ToCharResponseStream.java:359)
    at com.caucho.server.connection.ToCharResponseStream.nextCharBuffer(ToCharResponseStream.java:168)
    at com.caucho.jsp.JspWriterAdapter.write(JspWriterAdapter.java:171)
    at com.caucho.jsp.AbstractBodyContent.print(AbstractBodyContent.java:216)
    at com.caucho.el.Expr.toStream(Expr.java:876)
    at com.caucho.el.Expr.print(Expr.java:425)

Notes
(0005428)
ferg   
08-05-11 09:51   
server/0818