-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Hello,
I found in the current implementation (1.4.6) a possible buffer overrun in EventLogChannel.
EventLogChannel::EventLogChannel():
_logFile("Application"),
_h(0)
{
#if defined(POCO_WIN32_UTF8)
wchar_t name[256];
int n = GetModuleFileNameW(NULL, name, sizeof(name));
// ...
}wchar_t name[256];
// -> array with 256 elements createdint n = GetModuleFileNameW(NULL, name, sizeof(name));
// -> Try to read 512 elements !!! because the length of one wchar_t is 2Fixed version:
EventLogChannel::EventLogChannel():
_logFile("Application"),
_h(0)
{
static const int length = 256;
#if defined(POCO_WIN32_UTF8)
wchar_t name[length];
int n = GetModuleFileNameW(NULL, name, length);
// ...
}Reactions are currently unavailable