You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2006/11/05 18:42:17 UTC

svn commit: r471473 - in /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore: include/version_svn_tag.h src/class_support/Class_File_Loader.cpp

Author: geirm
Date: Sun Nov  5 09:42:16 2006
New Revision: 471473

URL: http://svn.apache.org/viewvc?view=rev&rev=471473
Log:
HARMONY-1899

[drlvm] possible overflow while parsing annotations in classfile

While I'm doutful this could happen, this fix makes it clearly correct
returning an int32 into an int32

Ubuntu 6 - smoke, c-unit, ~kernel


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h?view=diff&rev=471473&r1=471472&r2=471473
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h Sun Nov  5 09:42:16 2006
@@ -18,6 +18,6 @@
 #ifndef _VERSION_SVN_TAG_
 #define _VERSION_SVN_TAG_
 
-#define VERSION_SVN_TAG  "471166"
+#define VERSION_SVN_TAG  "471468"
 
 #endif // _VERSION_SVN_TAG_

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=471473&r1=471472&r2=471473
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Sun Nov  5 09:42:16 2006
@@ -332,7 +332,7 @@
             return 0;
         }
 
-        uint16 size = parse_annotation_value(antn->elements[j].value, cfs, clss);
+        uint32 size = parse_annotation_value(antn->elements[j].value, cfs, clss);
         if (size == 0) {
             return 0;
         }
@@ -526,7 +526,7 @@
 
         for (unsigned i = 0; i < num_annotations; i++)
         {
-            uint16 size = parse_annotation((*table)->table + i, cfs, clss);
+            uint32 size = parse_annotation((*table)->table + i, cfs, clss);
             if (size == 0) {
                 return 0;
             }
@@ -1637,7 +1637,7 @@
                 _default_value = (AnnotationValue *)_class->class_loader->Alloc(
                     sizeof(AnnotationValue));
 
-                uint16 read_len = parse_annotation_value(*_default_value, cfs, clss);
+                uint32 read_len = parse_annotation_value(*_default_value, cfs, clss);
                 if (read_len == 0) {
                     return false;
                 } else if (read_len != attr_len) {