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 cc9c33cb1bbdb8c166b791e8bed81fa7b82a9407
Author: Gary David Gregory (Code signing key) <[email protected]>
AuthorDate: Mon Nov 21 16:26:30 2022 -0500

    org.apache.bcel.classfile.ModulePackages constructors now throw
    ClassFormatException on invalid input
---
 src/changes/changes.xml                                     | 1 +
 src/main/java/org/apache/bcel/classfile/ModulePackages.java | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a3b45240..3fb0bf6e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -107,6 +107,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">org.apache.bcel.classfile.LocalVariableTable constructors now throw 
ClassFormatException on invalid input.</action>
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">org.apache.bcel.classfile.LocalVariableTypeTable constructors now 
throw ClassFormatException on invalid input.</action>
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">org.apache.bcel.classfile.ModuleMainClass constructors now throw 
ClassFormatException on invalid input.</action>
+      <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">org.apache.bcel.classfile.ModulePackages 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/ModulePackages.java 
b/src/main/java/org/apache/bcel/classfile/ModulePackages.java
index 212d96c1..c57e1e8a 100644
--- a/src/main/java/org/apache/bcel/classfile/ModulePackages.java
+++ b/src/main/java/org/apache/bcel/classfile/ModulePackages.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.Arrays;
 
 import org.apache.bcel.Const;
+import org.apache.bcel.util.Args;
 import org.apache.commons.lang3.ArrayUtils;
 
 /**
@@ -62,6 +63,7 @@ public final class ModulePackages extends Attribute {
     public ModulePackages(final int nameIndex, final int length, final int[] 
packageIndexTable, final ConstantPool constantPool) {
         super(Const.ATTR_MODULE_PACKAGES, nameIndex, length, constantPool);
         this.packageIndexTable = packageIndexTable != null ? packageIndexTable 
: ArrayUtils.EMPTY_INT_ARRAY;
+        Args.requireU2(this.packageIndexTable.length, 
"packageIndexTable.length");
     }
 
     /**

Reply via email to