Skip to content

Commit

Permalink
prevent exception cloning search results with partial filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Apr 26, 2024
1 parent d3d5c91 commit ce3483d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/services/SearchResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ class MemBlock
if (!AreAllAddressesMatching())
{
if ((m_nMatchingAddresses + 7) / 8 > sizeof(m_vAddresses))
std::memcpy(m_pAddresses, other.m_pAddresses, (m_nMatchingAddresses + 7) / 8);
{
auto* pAddresses = AllocateMatchingAddresses();
if (pAddresses != nullptr)
std::memcpy(pAddresses, other.m_pAddresses, (m_nMatchingAddresses + 7) / 8);
}
else
{
std::memcpy(m_vAddresses, other.m_vAddresses, sizeof(m_vAddresses));
}
}
}

Expand Down

0 comments on commit ce3483d

Please sign in to comment.