diff options
author | Sergey Yershov <syershov@maps.me> | 2016-11-03 18:36:07 +0300 |
---|---|---|
committer | Sergey Yershov <syershov@maps.me> | 2016-11-03 18:58:25 +0300 |
commit | f7f919196a304f0a605a6f35c80696e8aea215f7 (patch) | |
tree | ab2d198bf79785122e80eb5877c44a8652eb273a /tracking/protocol.cpp | |
parent | dd7fce49f693edd4019552bede68bb878ae72b77 (diff) |
[tracking] Fix skipping absent packet header
Diffstat (limited to 'tracking/protocol.cpp')
-rw-r--r-- | tracking/protocol.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tracking/protocol.cpp b/tracking/protocol.cpp index aea3402203..c0cfab40c0 100644 --- a/tracking/protocol.cpp +++ b/tracking/protocol.cpp @@ -79,11 +79,10 @@ pair<Protocol::PacketType, size_t> Protocol::DecodeHeader(vector<uint8_t> const // static string Protocol::DecodeAuthPacket(Protocol::PacketType type, vector<uint8_t> const & data) { - ASSERT_GREATER_OR_EQUAL(data.size(), sizeof(uint32_t /* header */), ()); switch (type) { case Protocol::PacketType::AuthV0: - return string(begin(data) + sizeof(uint32_t /* header */), end(data)); + return string(begin(data), end(data)); case Protocol::PacketType::DataV0: break; } return string(); @@ -92,11 +91,9 @@ string Protocol::DecodeAuthPacket(Protocol::PacketType type, vector<uint8_t> con // static Protocol::DataElementsVec Protocol::DecodeDataPacket(PacketType type, vector<uint8_t> const & data) { - ASSERT_GREATER_OR_EQUAL(data.size(), sizeof(uint32_t /* header */), ()); DataElementsVec points; MemReader memReader(data.data(), data.size()); ReaderSource<MemReader> src(memReader); - src.Skip(sizeof(uint32_t /* header */)); switch (type) { case Protocol::PacketType::DataV0: |