DiscIO: Fix out-of-bounds access in NANDContentDataBuffer

Accessing buffer[start + size] triggers an error (and a crash) in debug
builds. Using std::copy_n fixes this.
This commit is contained in:
Léo Lam 2017-01-23 21:49:26 +01:00
parent 86b758d7ca
commit 3d21280ab4

View File

@ -196,7 +196,7 @@ bool CNANDContentDataBuffer::GetRange(u32 start, u32 size, u8* buffer)
if (start + size > m_buffer.size())
return false;
std::copy(&m_buffer[start], &m_buffer[start + size], buffer);
std::copy_n(&m_buffer[start], size, buffer);
return true;
}