From 0eaf9429c99ea1050405860323238254f675c524 Mon Sep 17 00:00:00 2001 From: Sergey Kostin <7er@inbox.ru> Date: Tue, 6 Aug 2019 11:44:56 +0300 Subject: code review edits --- src/main/java/org/traccar/protocol/EgtsProtocolDecoder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/traccar/protocol/EgtsProtocolDecoder.java b/src/main/java/org/traccar/protocol/EgtsProtocolDecoder.java index 4c2781963..ebfe5f8f3 100644 --- a/src/main/java/org/traccar/protocol/EgtsProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/EgtsProtocolDecoder.java @@ -139,9 +139,8 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder { return null; } - int frameDataEnd = buf.readerIndex() + frameDataLength; long objectId = 0L; - while (buf.readerIndex() < frameDataEnd) { + while (buf.readableBytes() > 2) { int length = buf.readUnsignedShortLE(); int recordIndex = buf.readUnsignedShortLE(); -- cgit v1.2.3