aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/At2000ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/At2000ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/At2000ProtocolDecoder.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/At2000ProtocolDecoder.java b/src/org/traccar/protocol/At2000ProtocolDecoder.java
index dc799054d..182066629 100644
--- a/src/org/traccar/protocol/At2000ProtocolDecoder.java
+++ b/src/org/traccar/protocol/At2000ProtocolDecoder.java
@@ -102,6 +102,10 @@ public class At2000ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
+ if (buf.capacity() <= BLOCK_LENGTH) {
+ return null; // empty message
+ }
+
byte[] data = new byte[buf.capacity() - BLOCK_LENGTH];
buf.readBytes(data);
buf = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, cipher.update(data));