mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
Merge pull request #39731 from mychoxin/use_unified_zero_func
rbd: use portable zero-ing memory function Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
commit
2bda8970e1
@ -212,7 +212,7 @@ void LoadRequest<I>::read_volume_key() {
|
||||
|
||||
template <typename I>
|
||||
void LoadRequest<I>::finish(int r) {
|
||||
explicit_bzero(&m_passphrase[0], m_passphrase.size());
|
||||
ceph_memzero_s(&m_passphrase[0], m_passphrase.size(), m_passphrase.size());
|
||||
m_on_finish->complete(r);
|
||||
delete this;
|
||||
}
|
||||
|
@ -1660,7 +1660,7 @@ static int do_map(int argc, const char *argv[], Config *cfg, bool reconnect)
|
||||
std::string passphrase((std::istreambuf_iterator<char>(file)),
|
||||
(std::istreambuf_iterator<char>()));
|
||||
auto sg = make_scope_guard([&] {
|
||||
explicit_bzero(&passphrase[0], passphrase.size()); });
|
||||
ceph_memzero_s(&passphrase[0], passphrase.size(), passphrase.size()); });
|
||||
file.close();
|
||||
if (!passphrase.empty() && passphrase[passphrase.length() - 1] == '\n') {
|
||||
passphrase.erase(passphrase.length() - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user