* java/lang/natSystem.cc (arraycopy): Check for overflow.
From-SVN: r69706
This commit is contained in:
parent
1143680eca
commit
ed6d741317
@ -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>
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user