| 62 | |
| 63 | namespace { |
| 64 | void SecureMove(std::string& string, std::string& dst) { |
| 65 | auto ptr = string.data(); |
| 66 | dst = std::move(string); |
| 67 | |
| 68 | // We require the buffer address string.data() to remain (not be freed) as is, |
| 69 | // or to be reused by dst. Otherwise, we cannot securely clear string after std::move |
| 70 | ARROW_CHECK(string.data() == ptr || dst.data() == ptr); |
| 71 | } |
| 72 | } // namespace |
| 73 | |
| 74 | void SecureString::SecureClear(std::string* secret) { |
no test coverage detected