mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-22 15:32:24 +00:00
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
This commit is contained in:
parent
9ec44a2b06
commit
5f801b6adf
1 changed files with 1 additions and 2 deletions
|
@ -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…
Reference in a new issue