summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/NANDContentLoader.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-01-23 21:49:26 +0100
committerLéo Lam <leo@innovatetechnologi.es>2017-01-23 21:49:26 +0100
commit3d21280ab415005f0fbe1dd92e3c8301094b044b (patch)
treeda5476609d355f59217253e88131e954a7d0e648 /Source/Core/DiscIO/NANDContentLoader.cpp
parent86b758d7caa0ddbd34f01051e61c8ee68b6f89f9 (diff)
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.
Diffstat (limited to 'Source/Core/DiscIO/NANDContentLoader.cpp')
-rw-r--r--Source/Core/DiscIO/NANDContentLoader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp
index f87e0e31c0..b57f6eb0ea 100644
--- a/Source/Core/DiscIO/NANDContentLoader.cpp
+++ b/Source/Core/DiscIO/NANDContentLoader.cpp
@@ -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;
}