summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-08-07 22:13:06 +0000
committerMark Wielaard <mark@klomp.org>2006-08-07 22:13:06 +0000
commit5dd796b02c0f49d5efe25df775d3870d881cfb01 (patch)
tree6e1c00a72712eb351ce2ab7e0ad3fcda2e3f23bf
parent20281a9d68dc797fdb47b42c55346c12ebe91930 (diff)
downloadclasspath-5dd796b02c0f49d5efe25df775d3870d881cfb01.tar.gz
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.
-rw-r--r--ChangeLog11
-rw-r--r--java/nio/DirectByteBufferImpl.java1
-rw-r--r--native/jni/java-nio/java_nio_VMDirectByteBuffer.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d7bf1b6ac..2f74170fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
-2006-08-07 Sven de Marothy <sven@physto.se>
+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
(drawGlyphVector): Synchronize against font object when drawing.
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);
}