3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 10:45:51 +00:00

Fix Integer overflow in BitcoinSerializer.BitcoinPacketHeader

This commit is contained in:
Willem Noort 2016-03-24 13:52:19 +01:00
parent 0ebdd5bbea
commit 9b2ad15cd3

View File

@ -367,7 +367,7 @@ public class BitcoinSerializer extends MessageSerializer {
size = (int) readUint32(header, cursor);
cursor += 4;
if (size > Message.MAX_SIZE)
if (size > Message.MAX_SIZE || size < 0)
throw new ProtocolException("Message size too large: " + size);
// Old clients don't send the checksum.