mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 05:27:17 +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 {
|
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);
|
throw new ProtocolException("Claimed value length too large: " + length);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user