Advertisement
PVS-StudioWarnings

PVS-Studio warning V576 for ReactOS

Nov 21st, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. static HRESULT STDMETHODCALLTYPE
  2. CBindStatusCallback_OnProgress(....)
  3. {
  4.   ...
  5.   if (This->szMimeType[0] != _T('\0'))
  6.     _tprintf(_T("Length: %I64u [%s]\n"),
  7.       This->Size, This->szMimeType);
  8.   else
  9.     _tprintf(_T("Length: %ull\n"), This->Size);
  10.   ...
  11. }
  12.  
  13. %I64u should be used as well in the second case: _tprintf(_T("Length: %I64u\n"), This->Size);
  14.  
  15. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V576 Incorrect format. Consider checking the second actual argument of the 'wprintf' function. The argument is expected to be not greater than 32-bit. dwnl dwnl.c 229
  18.  
  19. 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