6636363: BufferUnderflowException decoding length 6 UTF-8 sequences with direct buffers
authormartin
Sat, 10 May 2008 11:30:53 -0700
changeset 492 d34fdbd7da77
parent 491 a394684ccfe6
child 493 b8102e80be10
6636363: BufferUnderflowException decoding length 6 UTF-8 sequences with direct buffers Reviewed-by: sherman
jdk/src/share/classes/sun/nio/cs/UTF_8.java
--- a/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Thu May 08 09:16:03 2008 -0400
+++ b/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Sat May 10 11:30:53 2008 -0700
@@ -326,7 +326,7 @@
 
                         case 12: case 13:
                             // 6 bytes, 31 bits
-                            if (src.remaining() < 4)
+                            if (src.remaining() < 5)
                                 return CoderResult.UNDERFLOW;
                             if (!isContinuation(b2 = src.get()))
                                 return CoderResult.malformedForLength(1);