Skip to content

Commit

Permalink
prevent exception cloning search results with partial filter (RetroAc…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored May 2, 2024
1 parent f520150 commit ba3b5a2
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 ba3b5a2

Please sign in to comment.