diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | java/nio/DirectByteBufferImpl.java | 1 | ||||
-rw-r--r-- | native/jni/java-nio/java_nio_VMDirectByteBuffer.c | 2 |
3 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,12 @@ +2006-08-07 C. Scott Marshall <csm@gnu.org> + + Fixes PR 28608. + * java/nio/DirectByteBufferImpl.java (duplicate): only reset if + the mark has been set. + * native/jni/java-nio/java_nio_VMDirectByteBuffer.c + (Java_java_nio_VMDirectByteBuffer_allocate): zero out the + allocated data. + 2006-08-07 Sven de Marothy <sven@physto.se> * gnu/java/awt/peer/gtk/CairoGraphics2D.java diff --git a/java/nio/DirectByteBufferImpl.java b/java/nio/DirectByteBufferImpl.java index 53bb668aa..3a9036f31 100644 --- a/java/nio/DirectByteBufferImpl.java +++ b/java/nio/DirectByteBufferImpl.java @@ -232,6 +232,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer private ByteBuffer duplicate(boolean readOnly) { int pos = position(); + if (this.mark != -1) reset(); int mark = position(); position(pos); diff --git a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c index f725cf2a4..bfee7e9dc 100644 --- a/native/jni/java-nio/java_nio_VMDirectByteBuffer.c +++ b/native/jni/java-nio/java_nio_VMDirectByteBuffer.c @@ -60,6 +60,8 @@ Java_java_nio_VMDirectByteBuffer_allocate return 0; } + memset (buffer, 0, capacity); + return JCL_NewRawDataObject (env, buffer); } |