You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/21 18:48:46 UTC
[commons-bcel] 01/02: org.apache.bcel.classfile.InnerClasses constructors now throw ClassFormatException on invalid input
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 3b2d41ca8834abdb5453b2d97f6dcf44c4ff9a23
Author: Gary David Gregory (Code signing key) <gg...@apache.org>
AuthorDate: Mon Nov 21 13:30:39 2022 -0500
org.apache.bcel.classfile.InnerClasses constructors now throw
ClassFormatException on invalid input
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/bcel/classfile/InnerClasses.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index dde59cbb..a27605ea 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -101,6 +101,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="markt" due-to="Mark Thomas, Gary Gregory">org.apache.bcel.classfile.Attribute constructors now throw ClassFormatException on invalid length input.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">org.apache.bcel.classfile.CodeException constructors now throw ClassFormatException on invalid input.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">org.apache.bcel.classfile.ExceptionTable constructors now throw ClassFormatException on invalid input.</action>
+ <action type="fix" dev="ggregory" due-to="Gary Gregory">org.apache.bcel.classfile.InnerClasses constructors now throw ClassFormatException on invalid input.</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump spotbugs-maven-plugin from 4.7.2.2 to 4.7.3.0 #167.</action>
<action type="update" dev="ggregory" due-to="Dependabot">Bump jmh.version from 1.35 to 1.36 #170.</action>
diff --git a/src/main/java/org/apache/bcel/classfile/InnerClasses.java b/src/main/java/org/apache/bcel/classfile/InnerClasses.java
index dda63e80..484b551d 100644
--- a/src/main/java/org/apache/bcel/classfile/InnerClasses.java
+++ b/src/main/java/org/apache/bcel/classfile/InnerClasses.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.stream.Stream;
import org.apache.bcel.Const;
+import org.apache.bcel.util.Args;
/**
* This class is derived from <em>Attribute</em> and denotes that this class is an Inner class of another. to the source
@@ -75,6 +76,7 @@ public final class InnerClasses extends Attribute implements Iterable<InnerClass
public InnerClasses(final int nameIndex, final int length, final InnerClass[] innerClasses, final ConstantPool constantPool) {
super(Const.ATTR_INNER_CLASSES, nameIndex, length, constantPool);
this.innerClasses = innerClasses != null ? innerClasses : EMPTY_INNER_CLASSE_ARRAY;
+ Args.requireU2(this.innerClasses.length, "innerClasses.length");
}
/**