PVS-StudioWarnings

PVS-Studio warning V575 for ReactOS

Nov 19th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. DWORD ParseReasonCode(LPCWSTR code)
  2. {
  3.   LPWSTR tmpPrefix = NULL;
  4.   ....
  5.   for (reasonptr = shutdownReason ;
  6.        reasonptr->prefix ; reasonptr++)
  7.   {
  8.     if ((majorCode == reasonptr->major) &&
  9.         (minorCode == reasonptr->minor) &&
  10.         (_wcsicmp(tmpPrefix, reasonptr->prefix) != 0))
  11.     {
  12.       return reasonptr->flag;
  13.     }
  14.   }
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V575 The null pointer is passed into '_wcsicmp' function. Inspect the first argument. misc.c 150
  21.  
  22. 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