mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-19 19:52:15 +02:00
WriteFile takes DWORD, not size_t
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
parent
a52371a267
commit
2e10d21fa2
@ -499,7 +499,9 @@ class MyListener : public WS::Server::Listener
|
||||
|
||||
// write management password to process's stdin
|
||||
DWORD written;
|
||||
WriteFile(stdin_write, management_password.c_str(), management_password.length(), &written, NULL);
|
||||
if (!is_safe_conversion<DWORD>(management_password.length()))
|
||||
return;
|
||||
WriteFile(stdin_write, management_password.c_str(), static_cast<DWORD>(management_password.length()), &written, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@ inline void log(const HANDLE file, const std::string &str)
|
||||
{
|
||||
DWORD n_written;
|
||||
const std::string line = date_time() + ' ' + str;
|
||||
::WriteFile(file, line.c_str(), line.length(), &n_written, NULL);
|
||||
::WriteFile(file, line.c_str(), static_cast<DWORD>(line.length()), &n_written, NULL);
|
||||
}
|
||||
|
||||
inline ScopedHANDLE create_file(const std::string &fn,
|
||||
|
Loading…
Reference in New Issue
Block a user