PVS-StudioWarnings

PVS-Studio warning V547 for UltimateTCPIP

Nov 20th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. int CUT_MimeEncode::Encode7bit(....)
  2. {
  3.   ...
  4.   char buf[1000];
  5.   ...
  6.   for ( t=0; t<bytesRead; t++ ) {
  7.     if (buf[t]==0 || buf[t]>127) {
  8.       retval = UTE_ENCODING_INVALID_CHAR;
  9.       break;
  10.     }
  11.   ...
  12. }
  13.  
  14. This suspicious code was found in UltimateTCPIP project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression 'buf[t] > 127' is always false. The value range of signed char type: [-128, 127]. UTImap4 utmime.cpp 320
  17.  
  18. 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