mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-30 19:41:24 +00:00
Message.readBytes(): Fail fast if length is too large
This commit is contained in:
committed by
Andreas Schildbach
parent
26adf68948
commit
694955c98b
@@ -329,7 +329,7 @@ public abstract class Message {
|
||||
}
|
||||
|
||||
protected byte[] readBytes(int length) throws ProtocolException {
|
||||
if (length > MAX_SIZE) {
|
||||
if ((length > MAX_SIZE) || (cursor + length > payload.length)) {
|
||||
throw new ProtocolException("Claimed value length too large: " + length);
|
||||
}
|
||||
try {
|
||||
|
Reference in New Issue
Block a user