diff options
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index d8da7e6de..dbbaeaf03 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -182,6 +182,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } if (length > 0) { + if (length > 12) { + length = 12; + } buf.skipBytes(length - 12); // skip reserved } @@ -202,7 +205,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedShort(), buf.readUnsignedByte(), buf.readUnsignedShort(), buf.readUnsignedMedium()))); if (length > 0) { - buf.skipBytes(length - 8); + if (hasLength) { + buf.skipBytes(length - 9); + } else { + buf.skipBytes(length - 8); + } } return true; |