Thanks. That may work:
for (size_t i = 0; i < str.size(); i++) {
std::string::reference pch = str[i];
char* ptr = &pch;
sanitize_one_char_by_pointer(ptr, '\0'); // For instance on Windows, call SecureZeroMemory()
}
---
or
for (size_t i = 0; i < str.size(); i++) {
str[i] = '\0';
std::string::reference pch = str[i];
volatile char* ptr = &pch;
}
---
Is it what you meant?
|