censor user credentials in logs by default

This commit is contained in:
Martin Michelsen
2026-05-16 16:58:27 -07:00
parent ecc61b7d1f
commit 0d5cfc6ccc
25 changed files with 445 additions and 105 deletions
+8 -2
View File
@@ -486,8 +486,14 @@ struct pstring {
uint8_t data[Bytes];
pstring() {
memset(this->data, 0, Bytes);
pstring(uint8_t v = 0) {
memset(this->data, v, Bytes);
}
pstring(const void* data, size_t size) {
memcpy(this->data, data, std::min<size_t>(size, Bytes));
if (size < Bytes) {
memset(this->data + size, 0, Bytes - size);
}
}
pstring(const pstring<Encoding, Chars, BytesPerChar>& other) {
memcpy(this->data, other.data, Bytes);