PVS-StudioWarnings

PVS-Studio warning V531 for ReactOS

Nov 11th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. VOID
  2. DisplayEvent(HWND hDlg)
  3. {
  4.   WCHAR szEventType[MAX_PATH];
  5.   WCHAR szTime[MAX_PATH];
  6.   WCHAR szDate[MAX_PATH];
  7.   WCHAR szUser[MAX_PATH];
  8.   WCHAR szComputer[MAX_PATH];
  9.   ....
  10.   ListView_GetItemText(...., sizeof(szEventType)*sizeof(WCHAR));
  11.   ListView_GetItemText(...., sizeof(szDate)*sizeof(WCHAR));
  12.   ListView_GetItemText(...., sizeof(szTime)*sizeof(WCHAR));
  13.   ListView_GetItemText(...., sizeof(szSource)*sizeof(WCHAR));
  14.   ListView_GetItemText(...., sizeof(szCategory)*sizeof(WCHAR));
  15.   ListView_GetItemText(...., sizeof(szEventID)*sizeof(WCHAR));
  16.   ListView_GetItemText(...., sizeof(szUser)*sizeof(WCHAR));
  17.   ListView_GetItemText(...., sizeof(szComputer)*sizeof(WCHAR));
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V531 It is odd that a sizeof() operator is multiplied by sizeof(). eventvwr.c 1117
  24.  
  25. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment