encoding: Fixing bugs in EncodingBlock and Block
Several Block constructors incorrectly initialized value boundaries.
Change-Id: I0d8a4fe73cc24530245862e0428e617437078bf0
refs: #1256, #1257
diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp
index 9c8ba1e..5409879 100644
--- a/src/encoding/block.cpp
+++ b/src/encoding/block.cpp
@@ -39,8 +39,8 @@
, m_end(m_buffer->end())
, m_size(m_end - m_begin)
{
- m_value_begin = m_buffer->begin();
- m_value_end = m_buffer->end();
+ m_value_begin = m_begin;
+ m_value_end = m_end;
m_type = Tlv::readType(m_value_begin, m_value_end);
@@ -58,8 +58,8 @@
, m_end(end)
, m_size(m_end - m_begin)
{
- m_value_begin = m_buffer->begin();
- m_value_end = m_buffer->end();
+ m_value_begin = m_begin;
+ m_value_end = m_end;
m_type = Tlv::readType(m_value_begin, m_value_end);
uint64_t length = Tlv::readVarNumber(m_value_begin, m_value_end);