Merged revisions 8299-8320 via svnmerge from
[cacao.git] / src / native / vm / sun_misc_Unsafe.c
index 11ec8c5c448d21d68626cf63bc7c6379a64fad19..42ce71ac1c604e3507165169d9c66ee41b5db56e 100644 (file)
@@ -535,7 +535,7 @@ JNIEXPORT int32_t JNICALL Java_sun_misc_Unsafe_addressSize(JNIEnv *env, sun_misc
  * Method:    defineClass
  * Signature: (Ljava/lang/String;[BIILjava/lang/ClassLoader;Ljava/security/ProtectionDomain;)Ljava/lang/Class;
  */
-JNIEXPORT java_lang_Class* JNICALL Java_sun_misc_Unsafe_defineClass__Ljava_lang_String_2_3BIILjava_lang_ClassLoader_2Ljava_security_ProtectionDomain_2(JNIEnv *env, sun_misc_Unsafe *this, java_lang_String *name, java_bytearray *b, int32_t off, int32_t len, java_lang_ClassLoader *loader, java_security_ProtectionDomain *protectionDomain)
+JNIEXPORT java_lang_Class* JNICALL Java_sun_misc_Unsafe_defineClass__Ljava_lang_String_2_3BIILjava_lang_ClassLoader_2Ljava_security_ProtectionDomain_2(JNIEnv *env, sun_misc_Unsafe *this, java_lang_String *name, java_handle_bytearray_t *b, int32_t off, int32_t len, java_lang_ClassLoader *loader, java_security_ProtectionDomain *protectionDomain)
 {
        classloader     *cl;
        utf             *utfname;
@@ -553,7 +553,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_sun_misc_Unsafe_defineClass__Ljava_lang_
 
        /* check the indexes passed */
 
-       if ((off < 0) || (len < 0) || ((off + len) > b->header.size)) {
+       if ((off < 0) || (len < 0) || ((off + len) > LLNI_array_size(b))) {
                exceptions_throw_arrayindexoutofboundsexception();
                return NULL;
        }