Unverified Commit 8e7bf420 authored by oneiric's avatar oneiric

Identity: fix compiler size-compare error

Fixes compiler error about comparing long to size_t.
parent c8e9e7e7
......@@ -212,7 +212,7 @@ std::size_t IdentityEx::FromBuffer(
memcpy(&m_StandardIdentity, buf, IdentitySizes::Default);
if (m_StandardIdentity.certificate.length) {
m_ExtendedLen = boost::endian::big_to_native(m_StandardIdentity.certificate.length);
if (m_ExtendedLen + IdentitySizes::Default <= len) {
if (std::size_t(m_ExtendedLen + IdentitySizes::Default) <= len) {
m_ExtendedBuffer = std::make_unique<std::uint8_t[]>(m_ExtendedLen);
memcpy(
m_ExtendedBuffer.get(), buf + IdentitySizes::Default, m_ExtendedLen);
......@@ -243,7 +243,7 @@ std::size_t IdentityEx::ToBuffer(
memcpy(buf, &m_StandardIdentity, IdentitySizes::Default);
if (m_ExtendedLen > 0 && m_ExtendedBuffer)
{
if (buflen < IdentitySizes::Default + m_ExtendedLen)
if (buflen < std::size_t(IdentitySizes::Default + m_ExtendedLen))
throw std::length_error("IdentityEx: supplied buffer is too small");
memcpy(buf + IdentitySizes::Default, m_ExtendedBuffer.get(), m_ExtendedLen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment