diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-19 14:00:41 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-19 14:00:41 +0000 |
commit | 5f801b6adfeb8d0fa8afc1183ff3ff5318624221 (patch) | |
tree | d07338b793dfddd748d71969aeea7b86e55bc085 /contrib | |
parent | wipeable_string: fix clear and push_back (diff) | |
download | monero-5f801b6adfeb8d0fa8afc1183ff3ff5318624221.tar.xz |
wipeable_string: ignore reserve size less than actual size
This was asserting, but stoffu pointed out the std::string standard
considers this ok and ignorable
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/epee/src/wipeable_string.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/epee/src/wipeable_string.cpp b/contrib/epee/src/wipeable_string.cpp index c8fed7bb3..2ec1e5469 100644 --- a/contrib/epee/src/wipeable_string.cpp +++ b/contrib/epee/src/wipeable_string.cpp @@ -85,9 +85,8 @@ void wipeable_string::wipe() void wipeable_string::grow(size_t sz, size_t reserved) { CHECK_AND_ASSERT_THROW_MES(wipefunc, "wipefunc is not set"); - if (reserved == 0) + if (reserved < sz) reserved = sz; - CHECK_AND_ASSERT_THROW_MES(reserved >= sz, "reserved < sz"); if (reserved <= buffer.capacity()) { buffer.resize(sz); |