aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index dfb0b5e07..e405bc195 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -251,8 +251,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.setNetwork(new Network(CellTower.from(
BitUtil.to(mcc, 15), mnc, buf.readUnsignedShort(), buf.readUnsignedMedium())));
- if (length > 0) {
- buf.skipBytes(length - (hasLength ? 9 : 8));
+ if (length > 9) {
+ buf.skipBytes(length - 9);
}
return true;
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 8ec422af3..8c884f366 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -16,6 +16,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyNotNull(decoder, binary(
+ "78781219028f0a29e10036f12003040102000875dc0d0a"));
+
verifyAttributes(decoder, binary(
"79790008940000ed0289d6860d0a"));