PVS-StudioWarnings

PVS-Studio warning V547 for ReactOS

Nov 26th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. typedef unsigned short WORD;
  2. WORD Id;
  3.  
  4. static LONG
  5. LdrpCompareResourceNames_U(....)
  6. {
  7.   /* Fail if ResourceName2 is an ID */
  8.   if (Entry->Id <= USHRT_MAX) return -1;
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V547 Expression 'Entry->Id <= 0xffff' is always true. The value range of unsigned short type: [0, 65535]. res.c 312
  15.  
  16. 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