Author: tfaber
Date: Mon Apr 28 08:15:28 2014
New Revision: 63031
URL:
http://svn.reactos.org/svn/reactos?rev=63031&view=rev
Log:
[EVENTVWR]
- Remove dead code in GetEventCategory
- Fix buffer overflows in DisplayEvent
- Patch by Víctor Martínez
CORE-8111 #resolve
Modified:
trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] Mon Apr 28
08:15:28 2014
@@ -261,18 +261,11 @@
EVENT_MESSAGE_FILE_BUFFER,
NULL) != 0)
{
- if (lpMsgBuf)
- {
- /* Trim the string */
- TrimNulls((LPWSTR)lpMsgBuf);
-
- /* Copy the category name */
- wcscpy(CategoryName, (LPCWSTR)lpMsgBuf);
- }
- else
- {
- wcscpy(CategoryName, (LPCWSTR)lpMsgBuf);
- }
+ /* Trim the string */
+ TrimNulls(lpMsgBuf);
+
+ /* Copy the category name */
+ wcscpy(CategoryName, lpMsgBuf);
}
else
{
@@ -1118,14 +1111,14 @@
if (iIndex != -1)
{
- ListView_GetItemText(hwndListView, iIndex, 0, szEventType, sizeof(szEventType) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 1, szDate, sizeof(szDate) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 2, szTime, sizeof(szTime) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 3, szSource, sizeof(szSource) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 4, szCategory, sizeof(szCategory) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 5, szEventID, sizeof(szEventID) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 6, szUser, sizeof(szUser) *
sizeof(WCHAR));
- ListView_GetItemText(hwndListView, iIndex, 7, szComputer, sizeof(szComputer) *
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 0, szEventType, sizeof(szEventType) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 1, szDate, sizeof(szDate) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 2, szTime, sizeof(szTime) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 3, szSource, sizeof(szSource) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 4, szCategory, sizeof(szCategory) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 5, szEventID, sizeof(szEventID) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 6, szUser, sizeof(szUser) /
sizeof(WCHAR));
+ ListView_GetItemText(hwndListView, iIndex, 7, szComputer, sizeof(szComputer) /
sizeof(WCHAR));
bEventData = !(pevlr->DataLength == 0);