aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-03 16:57:14 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-03 16:57:14 -0700
commit45cec80f310c966b63388b18a773533d0e9b9102 (patch)
treee24e206f08987cbdd3d7fde702697c9ddbdd373c /src/main/java
parent38961efd25373f290bb20780f770d17b425de88c (diff)
downloadtrackermap-server-45cec80f310c966b63388b18a773533d0e9b9102.tar.gz
trackermap-server-45cec80f310c966b63388b18a773533d0e9b9102.tar.bz2
trackermap-server-45cec80f310c966b63388b18a773533d0e9b9102.zip
Fix index usage
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
index d8a753abe..3ff8eb2fb 100644
--- a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -239,7 +239,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
private Object decodePositions(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
- int length = (buf.readUnsignedShortLE() & 0x7fff) + 3;
+ int endIndex = (buf.readUnsignedShortLE() & 0x7fff) + buf.readerIndex();
List<Position> positions = new LinkedList<>();
Set<Integer> tags = new HashSet<>();
@@ -248,7 +248,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
DeviceSession deviceSession = null;
Position position = new Position(getProtocolName());
- while (buf.readerIndex() < length) {
+ while (buf.readerIndex() < endIndex) {
int tag = buf.readUnsignedByte();
if (tags.contains(tag)) {