aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-01-21 20:05:01 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-01-21 20:05:01 +1300
commit3e809b9509b26e5446e1262c8d1dd5703b814f58 (patch)
treee3e7adbb7f12909ff103a107bd791b344c186f3a /src
parentd7adccdfe7f355f8ab62805663df68a706f15d0c (diff)
downloadtrackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.tar.gz
trackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.tar.bz2
trackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.zip
Progress bug workaround
Diffstat (limited to 'src')
-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 {