aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-23 15:30:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-23 15:30:04 +0000
commit6ccc51f64513e2c05afed453385af68bde072d8d (patch)
tree69e55f89a8a2c2e47bba115de05b8d417ab4e5e2
parentMerge pull request #2961 (diff)
downloadmonero-6ccc51f64513e2c05afed453385af68bde072d8d.tar.xz
wipeable_string: fix buffer overread
-rw-r--r--contrib/epee/src/wipeable_string.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/epee/src/wipeable_string.cpp b/contrib/epee/src/wipeable_string.cpp
index 894c47bbd..08a975e58 100644
--- a/contrib/epee/src/wipeable_string.cpp
+++ b/contrib/epee/src/wipeable_string.cpp
@@ -100,7 +100,7 @@ void wipeable_string::grow(size_t sz, size_t reserved)
wipefunc(buffer.data(), old_sz * sizeof(char));
buffer.reserve(reserved);
buffer.resize(sz);
- memcpy(buffer.data(), tmp.get(), sz * sizeof(char));
+ memcpy(buffer.data(), tmp.get(), old_sz * sizeof(char));
wipefunc(tmp.get(), old_sz * sizeof(char));
}