diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-08 11:13:34 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-08 11:13:34 +1200 |
commit | 7ed27b733d442cb442a8049263fab282b39e5872 (patch) | |
tree | 3015a779d32e89fd591068392c0ef019635a49a9 /src | |
parent | de56187c1a48b3c4388ff986bd318d4683f2a344 (diff) | |
download | trackermap-server-7ed27b733d442cb442a8049263fab282b39e5872.tar.gz trackermap-server-7ed27b733d442cb442a8049263fab282b39e5872.tar.bz2 trackermap-server-7ed27b733d442cb442a8049263fab282b39e5872.zip |
Handle GT06 empty string message (fix #1930)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 18524fcfa..6dc382a04 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -214,9 +214,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { int commandLength = buf.readUnsignedByte(); - buf.readUnsignedByte(); // server flag (reserved) - - position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII)); + if (commandLength > 0) { + buf.readUnsignedByte(); // server flag (reserved) + position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII)); + } buf.readUnsignedShort(); // language |