Fix two warnings:
e:\xeniface\src\xenagent\service.cpp(684): warning C26439: This kind offunction may not throw.
Declare it 'noexcept' (f.6). [E:\xeniface\vs2017\xenagent\xenagent.vcxproj]
e:\xeniface\src\xenagent\xenifacedevice.cpp(57): warning C26451: Arithmetic overflow: Using operator
'+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before
calling operator '+' to avoid overflow (io.2). [E:\xeniface\vs2017\xenagent\xenagent.vcxproj]
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
#pragma warning(push)
#pragma warning(disable:4355)
-CXenAgent::CXenAgent() : m_handle(NULL), m_evtlog(NULL), m_xeniface(*this),
+CXenAgent::CXenAgent() noexcept : m_handle(NULL), m_evtlog(NULL), m_xeniface(*this),
m_conv(*this)
{
m_status.dwServiceType = SERVICE_WIN32;
static DWORD WINAPI ServiceControlHandlerEx(DWORD, DWORD, LPVOID, LPVOID);
public: // ctor/dtor
- CXenAgent();
+ CXenAgent() noexcept;
virtual ~CXenAgent();
public:
NULL, 0,
&bytes);
- buffer = new char[bytes + 1];
+ buffer = new char[(size_t)bytes + 1];
if (buffer == NULL)
return false;