Author: spetreolle
Date: Wed Aug 27 20:59:27 2014
New Revision: 63965
URL:
http://svn.reactos.org/svn/reactos?rev=63965&view=rev
Log:
[EVENTLOG]
Fix crash in LogfCreate when LogName is NULL.
strsafe.h++;
Modified:
trunk/reactos/base/services/eventlog/file.c
Modified: trunk/reactos/base/services/eventlog/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/fil…
==============================================================================
--- trunk/reactos/base/services/eventlog/file.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/file.c [iso-8859-1] Wed Aug 27 20:59:27 2014
@@ -355,7 +355,8 @@
goto fail;
}
- lstrcpyW(pLogFile->LogName, LogName);
+ if(LogName)
+ StringCchCopy(pLogFile->LogName,lstrlenW(LogName) + 1, LogName);
pLogFile->FileName =
(WCHAR *) HeapAlloc(MyHeap,
@@ -368,7 +369,7 @@
goto fail;
}
- lstrcpyW(pLogFile->FileName, FileName->Buffer);
+ StringCchCopy(pLogFile->FileName, lstrlenW(FileName->Buffer) + 1,
FileName->Buffer);
pLogFile->OffsetInfo =
(PEVENT_OFFSET_INFO) HeapAlloc(MyHeap,