mirror of
https://github.com/monero-project/monero.git
synced 2024-12-25 13:09:24 +00:00
Merge pull request #1399
73ac3b8e
wallet2: avoid possible undefined behavior on empty string (moneromooo-monero)
This commit is contained in:
commit
b500a64524
1 changed files with 1 additions and 2 deletions
|
@ -191,8 +191,7 @@ boost::optional<tools::password_container> get_password(const boost::program_opt
|
|||
}
|
||||
|
||||
// Remove line breaks the user might have inserted
|
||||
password.erase(std::remove(password.end() - 1, password.end(), '\n'), password.end());
|
||||
password.erase(std::remove(password.end() - 1, password.end(), '\r'), password.end());
|
||||
boost::trim_right_if(password, boost::is_any_of("\r\n"));
|
||||
return {tools::password_container(std::move(password))};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue