Advertisement
PVS-StudioWarnings

PVS-Studio warning V642 for ReactOS

Nov 25th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. HRESULT WINAPI CRecycleBin::CompareIDs(....)
  2. {
  3.   ....
  4.   return MAKE_HRESULT(SEVERITY_SUCCESS, 0,
  5.    (unsigned short)memcmp(pidl1->mkid.abID,
  6.                           pidl2->mkid.abID,
  7.                           pidl1->mkid.cb));
  8. }
  9.  
  10. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  11. Warning message is:
  12. V642 Saving the 'memcmp' function result inside the 'unsigned short' type variable is inappropriate. The significant bits could be lost breaking the program's logic. recyclebin.cpp 542
  13.  
  14. 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