diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-22 23:52:41 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-22 23:52:41 -0800 |
commit | eb2697434dbbb8c12cad26df94e3a367880ac4db (patch) | |
tree | 2fd2f504c7542091c858f3fc560c19c91194e321 /src/main/java/org/traccar | |
parent | cdbb912a1552d2e8eb6590dbffb6799ee187b50b (diff) | |
download | trackermap-server-eb2697434dbbb8c12cad26df94e3a367880ac4db.tar.gz trackermap-server-eb2697434dbbb8c12cad26df94e3a367880ac4db.tar.bz2 trackermap-server-eb2697434dbbb8c12cad26df94e3a367880ac4db.zip |
Fix frame decoding issues
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/OmnicommFrameDecoder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/OmnicommFrameDecoder.java b/src/main/java/org/traccar/protocol/OmnicommFrameDecoder.java index 1caf6ceb9..314f19757 100644 --- a/src/main/java/org/traccar/protocol/OmnicommFrameDecoder.java +++ b/src/main/java/org/traccar/protocol/OmnicommFrameDecoder.java @@ -27,11 +27,11 @@ public class OmnicommFrameDecoder extends BaseFrameDecoder { protected Object decode( ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { - if (buf.readableBytes() < 10) { + if (buf.readableBytes() < 6) { return null; } - int endIndex = buf.getUnsignedShortLE(2) + buf.readerIndex() + 6; + int endIndex = buf.getUnsignedShortLE(buf.readerIndex() + 2) + buf.readerIndex() + 6; if (buf.writerIndex() < endIndex) { return null; } |