Skip to content

Commit

Permalink
Fix rebase conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilan Olkies committed Nov 15, 2023
1 parent 5e04c6d commit bd8d819
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rskj-core/src/main/java/org/ethereum/util/RLP.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ private static Pair<RLPElement, Integer> decodeListElement(byte[] msgData, int p
length = offset + bytesToLength(msgData, position + 1, offset - 1);
}

if (Long.compareUnsigned(length, Integer.MAX_VALUE) > 0) {
throw new RLPException("The current implementation doesn't support lengths longer than Integer.MAX_VALUE because that is the largest number of elements an array can have");
}

if (position + length > msgData.length) {
throw new RLPException("The RLP byte array doesn't have enough space to hold an element with the specified length");
}
Expand Down

0 comments on commit bd8d819

Please sign in to comment.