Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-7055

In EventViewer, DisplayEvent() calls ListView_GetItemText with wrong number of characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.3.17
    • Applications
    • None

    Description

      ListView_GetItemText is defined as:

      void ListView_GetItemText(
      HWND hwnd,
      int iItem,
      int iSubItem,
      LPTSTR pszText,
      int cchTextMax
      );

      cchTextMax: Stores the number of characters in the pszText buffer.

      But in DisplayEvent() ListView_GetItemText is called as follows:

      01117 ListView_GetItemText(hwndListView, iIndex, 0, szEventType, sizeof(szEventType) * sizeof(WCHAR));
      01118 ListView_GetItemText(hwndListView, iIndex, 1, szDate, sizeof(szDate) * sizeof(WCHAR));
      01119 ListView_GetItemText(hwndListView, iIndex, 2, szTime, sizeof(szTime) * sizeof(WCHAR));

      Instead "*" we should be using "/" to fix this issue.

      Detected thanks to PVS

      Attachments

        Activity

          People

            vicmarcal vicmarcal
            vicmarcal vicmarcal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: