aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/ProgressProtocolDecoder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java
index 43fce472c..57cf82235 100644
--- a/src/org/traccar/protocol/ProgressProtocolDecoder.java
+++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java
@@ -149,7 +149,9 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder {
if (subtype == MSG_ALARM) {
extendedInfo.append("<alarm>true</alarm>");
}
- buf.readUnsignedShort(); // length
+ if (buf.readUnsignedShort() > buf.readableBytes()) {
+ break; // workaround for device bug
+ }
lastIndex = buf.readUnsignedInt();
position.setId(lastIndex);
} else {