Commit ed6d7413 by Tom Tromey Committed by Tom Tromey

* java/lang/natSystem.cc (arraycopy): Check for overflow.

From-SVN: r69706
parent 1143680e
2003-07-23 Tom Tromey <tromey@redhat.com>
* java/lang/natSystem.cc (arraycopy): Check for overflow.
* boehm.cc (_Jv_BuildGCDescr): Use `1ULL'.
2003-07-22 Tom Tromey <tromey@redhat.com>
......
......@@ -66,8 +66,10 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
__JArray *src_a = (__JArray *) src;
__JArray *dst_a = (__JArray *) dst;
if (src_offset < 0 || dst_offset < 0 || count < 0
|| src_offset + count > src_a->length
|| dst_offset + count > dst_a->length)
|| (unsigned jint) src_offset > (unsigned jint) src_a->length
|| (unsigned jint) (src_offset + count) > (unsigned jint) src_a->length
|| (unsigned jint) dst_offset > (unsigned jint) dst_a->length
|| (unsigned jint) (dst_offset + count) > (unsigned jint) dst_a->length)
throw new ArrayIndexOutOfBoundsException;
// Do-nothing cases.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment