mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-22 14:22:36 +00:00
BufferPtr::Erase() previously delegated to Zero()/memset even though its current callers use it to wipe sensitive data. Expand burn() directly in the inline Erase implementation, matching VeraCrypt's established erasure design without adding an out-of-line wrapper. Install vector-referencing cleanup guards before token keyfile reads and fetches in the four GUI and text-mode import/export paths. This ensures partially populated data is wiped when an operation throws and avoids retaining a stale BufferPtr if the vector reallocates. Reject empty token exports before accessing vector::front(). Memory::Zero(), Buffer::Erase(), and the existing password guards remain unchanged. Co-authored-by: Damian Rickard <damian@rickard.us>