From 375fa71cb816acb25bd2eaf24ef5cc292a1f2c36 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 2 May 2024 17:01:09 +0200 Subject: use write and move in place for safer writing of files (#70) * use write and move in place for safer writing of files --- src/zenhttp/auth/authmgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/zenhttp/auth/authmgr.cpp') diff --git a/src/zenhttp/auth/authmgr.cpp b/src/zenhttp/auth/authmgr.cpp index a520e8fd1..bf151ce6d 100644 --- a/src/zenhttp/auth/authmgr.cpp +++ b/src/zenhttp/auth/authmgr.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -76,7 +77,7 @@ namespace details { return; } - WriteFile(Path, IoBuffer(IoBuffer::Wrap, EncryptedView.GetData(), EncryptedView.GetSize())); + TemporaryFile::SafeWriteFile(Path, EncryptedView); } } // namespace details -- cgit v1.2.3