From 3e809b9509b26e5446e1262c8d1dd5703b814f58 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 21 Jan 2013 20:05:01 +1300 Subject: Progress bug workaround --- src/org/traccar/protocol/ProgressProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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("true"); } - buf.readUnsignedShort(); // length + if (buf.readUnsignedShort() > buf.readableBytes()) { + break; // workaround for device bug + } lastIndex = buf.readUnsignedInt(); position.setId(lastIndex); } else { -- cgit v1.2.3