From 6ccc51f64513e2c05afed453385af68bde072d8d Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 23 Dec 2017 15:30:04 +0000 Subject: [PATCH] wipeable_string: fix buffer overread --- contrib/epee/src/wipeable_string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); }