Merge pull request #1352

d01f5c7 wallet2: fix illegal memory access removing newlines from password (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2016-11-24 12:53:14 +02:00
commit 570acdc686
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -191,7 +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.begin() - 1, password.end(), '\n'), password.end());
password.erase(std::remove(password.end() - 1, password.end(), '\n'), password.end());
password.erase(std::remove(password.end() - 1, password.end(), '\r'), password.end());
return {tools::password_container(std::move(password))};
}