Skip to content

Commit

Permalink
Fix possible NullPointerException in
Browse files Browse the repository at this point in the history
org.apache.bcel.classfile.StackMap.setStackMap(StackMapEntry[])
  • Loading branch information
garydgregory committed Nov 27, 2022
1 parent ce634b1 commit 2eb9736
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="markt" due-to="OSS-Fuzz">When parsing class files, limit arrays to no more than 255 dimensions as per section 4.4.1 of the JVM specification.</action>
<action type="fix" dev="ggregory" due-to="nbauma109">Tests and coverage for Utility class #175.</action>
<action type="fix" dev="ggregory" due-to="nbauma109">Unit tests and coverage for binary operations #174.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix possible NullPointerException in org.apache.bcel.classfile.StackMap.setStackMap(StackMapEntry[]).</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>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/bcel/classfile/StackMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public StackMapEntry[] getStackMap() {
public void setStackMap(final StackMapEntry[] table) {
this.table = table != null ? table : StackMapEntry.EMPTY_ARRAY;
int len = 2; // Length of 'number_of_entries' field prior to the array of stack maps
for (final StackMapEntry element : table) {
for (final StackMapEntry element : this.table) {
len += element.getMapEntrySize();
}
setLength(len);
Expand Down

0 comments on commit 2eb9736

Please sign in to comment.