aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-29 12:38:26 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-29 12:38:26 +1200
commit9ab536ca8c4e1ad850cb5fa08bbe99f14676b535 (patch)
treeba56d09083f55592fbc0b6b899c9655a5ea72a59 /src/org/traccar/protocol
parent2e9842ebfa6d8b4d053d66c437a11190a0f49e6e (diff)
downloadtrackermap-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.tar.gz
trackermap-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.tar.bz2
trackermap-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.zip
Fix GT06 protocol decoder (fix #1308)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index fde34c8f7..018b42dc9 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -197,7 +197,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_MNC, buf.readUnsignedByte());
position.set(Event.KEY_LAC, buf.readUnsignedShort());
position.set(Event.KEY_CELL, buf.readUnsignedShort() << 8 + buf.readUnsignedByte());
- buf.skipBytes(lbsLength - 9);
+ if (lbsLength > 0) {
+ buf.skipBytes(lbsLength - 9);
+ }
// Status
if (type == MSG_GPS_LBS_STATUS_1 || type == MSG_GPS_LBS_STATUS_2 || type == MSG_GPS_LBS_STATUS_3) {