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
pull/95/head
moneromooo-monero 7 years ago
parent 9ec44a2b06
commit 5f801b6adf
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -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);

Loading…
Cancel
Save