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

From-SVN: r69706
This commit is contained in:
Tom Tromey 2003-07-23 15:31:43 +00:00 committed by Tom Tromey
parent 1143680eca
commit ed6d741317
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
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>

View File

@ -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.