OSDN Git Service

2001-05-03 Martin Kahlert <martin.kahlert@infineon.com>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 May 2001 16:56:38 +0000 (16:56 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 May 2001 16:56:38 +0000 (16:56 +0000)
* jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
checking.
(_Jv_JNI_SetPrimitiveArrayRegion): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41795 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/jni.cc

index bc11bcf..018b62b 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-03  Martin Kahlert  <martin.kahlert@infineon.com>
+
+       * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
+       checking.
+       (_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
+
 2001-04-30  Andrew Haley  <aph@cambridge.redhat.com>
 
        * libgcj.spec.in (jc1): Add EXCEPTIONSPEC.
index 34f2995..3f5703a 100644 (file)
@@ -1366,7 +1366,7 @@ _Jv_JNI_GetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
 {
   // The cast to unsigned lets us save a comparison.
   if (start < 0 || len < 0
-      || (unsigned long) (start + len) >= (unsigned long) array->length)
+      || (unsigned long) (start + len) > (unsigned long) array->length)
     {
       try
        {
@@ -1393,7 +1393,7 @@ _Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
 {
   // The cast to unsigned lets us save a comparison.
   if (start < 0 || len < 0
-      || (unsigned long) (start + len) >= (unsigned long) array->length)
+      || (unsigned long) (start + len) > (unsigned long) array->length)
     {
       try
        {