Advertisement
PVS-StudioWarnings

PVS-Studio warning V595 for WinMerge

Nov 27th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. static DIFFITEM *AddToList(const String &sLeftDir,
  2.  const String &sRightDir,
  3.  const DirItem * lent, const DirItem * rent,
  4.  UINT code, DiffFuncStruct *myStruct, DIFFITEM *parent)
  5. {
  6.   ...
  7.   if (lent)
  8.   {
  9.     ...
  10.   }
  11.   else
  12.   {
  13.     di->left.filename = rent->filename;
  14.   }
  15.  
  16.   if (rent)
  17.   {
  18.   ...
  19. }
  20.  
  21. This suspicious code was found in WinMerge project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V595 The 'rent' pointer was utilized before it was verified against nullptr. Check lines: 608, 611. Merge dirscan.cpp 608
  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
Advertisement