diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-21 20:05:01 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-21 20:05:01 +1300 |
commit | 3e809b9509b26e5446e1262c8d1dd5703b814f58 (patch) | |
tree | e3e7adbb7f12909ff103a107bd791b344c186f3a /src/org/traccar/protocol/ProgressProtocolDecoder.java | |
parent | d7adccdfe7f355f8ab62805663df68a706f15d0c (diff) | |
download | trackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.tar.gz trackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.tar.bz2 trackermap-server-3e809b9509b26e5446e1262c8d1dd5703b814f58.zip |
Progress bug workaround
Diffstat (limited to 'src/org/traccar/protocol/ProgressProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/ProgressProtocolDecoder.java | 4 |
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 { |