mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-02 09:49:48 +02:00
GH124: Possible buffer overrun in EventLogChannel
This commit is contained in:
parent
daef0aa403
commit
ad66c4aac4
@ -22,6 +22,7 @@ Release 1.5.2 (2013-03-??)
|
|||||||
- added Recursive and SortedDirectoryIterator (Marian Krivos)
|
- added Recursive and SortedDirectoryIterator (Marian Krivos)
|
||||||
- added ListMap (map-like container with preserving insertion order)
|
- added ListMap (map-like container with preserving insertion order)
|
||||||
- MailMessage: attachments saving support and consistent read/write
|
- MailMessage: attachments saving support and consistent read/write
|
||||||
|
- fixed GH #124: Possibile buffer overrun in Foundation/EventLogChannel
|
||||||
|
|
||||||
Release 1.5.1 (2013-01-11)
|
Release 1.5.1 (2013-01-11)
|
||||||
==========================
|
==========================
|
||||||
|
@ -56,9 +56,10 @@ EventLogChannel::EventLogChannel():
|
|||||||
_logFile("Application"),
|
_logFile("Application"),
|
||||||
_h(0)
|
_h(0)
|
||||||
{
|
{
|
||||||
|
static const int length = 256;
|
||||||
#if defined(POCO_WIN32_UTF8)
|
#if defined(POCO_WIN32_UTF8)
|
||||||
wchar_t name[256];
|
wchar_t name[length];
|
||||||
int n = GetModuleFileNameW(NULL, name, sizeof(name));
|
int n = GetModuleFileNameW(NULL, name, length);
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
wchar_t* end = name + n - 1;
|
wchar_t* end = name + n - 1;
|
||||||
@ -68,8 +69,8 @@ EventLogChannel::EventLogChannel():
|
|||||||
UnicodeConverter::toUTF8(uname, _name);
|
UnicodeConverter::toUTF8(uname, _name);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char name[256];
|
char name[length];
|
||||||
int n = GetModuleFileNameA(NULL, name, sizeof(name));
|
int n = GetModuleFileNameA(NULL, name, length);
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
char* end = name + n - 1;
|
char* end = name + n - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user