GH124: Possible buffer overrun in EventLogChannel
This commit is contained in:
Родитель
daef0aa403
Коммит
ad66c4aac4
|
@ -22,6 +22,7 @@ Release 1.5.2 (2013-03-??)
|
|||
- added Recursive and SortedDirectoryIterator (Marian Krivos)
|
||||
- added ListMap (map-like container with preserving insertion order)
|
||||
- MailMessage: attachments saving support and consistent read/write
|
||||
- fixed GH #124: Possibile buffer overrun in Foundation/EventLogChannel
|
||||
|
||||
Release 1.5.1 (2013-01-11)
|
||||
==========================
|
||||
|
|
|
@ -56,9 +56,10 @@ EventLogChannel::EventLogChannel():
|
|||
_logFile("Application"),
|
||||
_h(0)
|
||||
{
|
||||
static const int length = 256;
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
wchar_t name[256];
|
||||
int n = GetModuleFileNameW(NULL, name, sizeof(name));
|
||||
wchar_t name[length];
|
||||
int n = GetModuleFileNameW(NULL, name, length);
|
||||
if (n > 0)
|
||||
{
|
||||
wchar_t* end = name + n - 1;
|
||||
|
@ -68,8 +69,8 @@ EventLogChannel::EventLogChannel():
|
|||
UnicodeConverter::toUTF8(uname, _name);
|
||||
}
|
||||
#else
|
||||
char name[256];
|
||||
int n = GetModuleFileNameA(NULL, name, sizeof(name));
|
||||
char name[length];
|
||||
int n = GetModuleFileNameA(NULL, name, length);
|
||||
if (n > 0)
|
||||
{
|
||||
char* end = name + n - 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче