harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r540620 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
Date Tue, 22 May 2007 15:58:05 GMT
Author: gshimansky
Date: Tue May 22 08:58:04 2007
New Revision: 540620

URL: http://svn.apache.org/viewvc?view=rev&rev=540620
Log:
Applied HARMONY-3832 [drlvm][classloader] VM does not throw ClassFormatError when class_info
contains wrong name_index


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=540620&r1=540619&r2=540620
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Tue May
22 08:58:04 2007
@@ -3094,7 +3094,15 @@
             return false;
         if(!valid_cpi(this, m_const_pool.get_class_name_index(super_class), CONSTANT_Utf8,
"for super class name"))
             return false;
-        m_super_class.name = m_const_pool.get_utf8_string(m_const_pool.get_class_name_index(super_class));
+
+        String* super_name = m_const_pool.get_utf8_string(m_const_pool.get_class_name_index(super_class));
+        if(!check_class_name(super_name->bytes, super_name->len, m_version < JAVA5_CLASS_FILE_VERSION))
{
+            REPORT_FAILED_CLASS_FORMAT(this, " Illegal super class name "
+                    << super_name->bytes);
+            return false;
+        }
+        m_super_class.name = super_name;
+
         if(is_interface() && m_super_class.name != env->JavaLangObject_String){
             REPORT_FAILED_CLASS_CLASS(m_class_loader, this, "java/lang/ClassFormatError",
                 m_name->bytes << ": the super class of interface is "



Mime
View raw message