PVS-StudioWarnings

PVS-Studio warning V503 for Chromium

Nov 18th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. void GetCacheParameters(ContextType type, FilePath* cache_path,
  2.                         int* max_size) {
  3.   ...
  4.   *max_size = 0;
  5.   if (!base::StringToInt(value, max_size)) {
  6.     *max_size = 0;
  7.   } else if (max_size < 0) {
  8.     *max_size = 0;
  9.   }
  10.   ...
  11. }
  12.  
  13. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V503 This is a nonsensical comparison: pointer < 0.  browser  profile_impl.cc  169
  16.  
  17. 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