Author: markt
Date: Wed Sep 10 20:59:30 2014
New Revision: 1624129

URL: http://svn.apache.org/r1624129
Log:
Fail fast

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1624129&r1=1624128&r2=1624129&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java Wed 
Sep 10 20:59:30 2014
@@ -115,10 +115,10 @@ public abstract class Attribute implemen
             Utility.swallowInnerClasses(file);
             return null;
         case Constants.ATTR_SYNTHETIC:
-            Utility.swallowSynthetic(file, length);
+            Utility.swallowSynthetic(length);
             return null;
         case Constants.ATTR_DEPRECATED:
-            Utility.swallowDeprecated(file, length);
+            Utility.swallowDeprecated(length);
             return null;
         case Constants.ATTR_PMG:
             return new PMGClass(name_index, length, file, constant_pool);

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1624129&r1=1624128&r2=1624129&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Wed 
Sep 10 20:59:30 2014
@@ -162,10 +162,8 @@ final class Utility {
         file.readUnsignedShort();   // Unused signature_index
     }
 
-    static void swallowSynthetic(DataInput file, int length) throws 
IOException {
+    static void swallowSynthetic(int length) {
         if (length > 0) {
-            byte[] bytes = new byte[length];
-            file.readFully(bytes);
             throw new ClassFormatException("Synthetic attribute with length > 
0");
         }
     }
@@ -247,10 +245,8 @@ final class Utility {
         }
     }
 
-    static void swallowDeprecated(DataInput file, int length) throws 
IOException {
+    static void swallowDeprecated(int length) {
         if (length > 0) {
-            byte[] bytes = new byte[length];
-            file.readFully(bytes);
             throw new ClassFormatException("Deprecated attribute with length > 
0");
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to