RFR: JDK-8039751: UTF-8 decoder fails to handle some edge cases correctly (original) (raw)

Alan Bateman Alan.Bateman at oracle.com
Sat Apr 12 09:53:07 UTC 2014


On 09/04/2014 22:51, Xueming Shen wrote:

Hi,

Please help review the fix for JDK-8039751. Issue: https://bugs.openjdk.java.net/browse/JDK-8039751 webrev: http://cr.openjdk.java.net/~sherman/8039751/webrev/

This is the corner case (in 4 bytes sequence) we missed when fixing 7096080 [1]. The UTF8 decoder correctly returns the malformed length for some malformed 4-byte illegal byte sequence (via Decoder.malformedN(...)), but it fails to do so if there is no enough (< 4 bytes) bytes in input buffer (via isMalfromed42(...)) This looks okay to me although I think it would be useful to put in an addition comment or two to make these corner cases a bit easier to understand when looking at this code.

-Alan.



More information about the core-libs-dev mailing list