diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-29 12:38:26 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-29 12:38:26 +1200 |
commit | 9ab536ca8c4e1ad850cb5fa08bbe99f14676b535 (patch) | |
tree | ba56d09083f55592fbc0b6b899c9655a5ea72a59 /src/org | |
parent | 2e9842ebfa6d8b4d053d66c437a11190a0f49e6e (diff) | |
download | traccar-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.tar.gz traccar-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.tar.bz2 traccar-server-9ab536ca8c4e1ad850cb5fa08bbe99f14676b535.zip |
Fix GT06 protocol decoder (fix #1308)
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 4 |
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) { |