PVS-StudioWarnings

PVS-Studio warning V595 for ffdshow

Nov 25th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. Tsubtitle* TsubtitleParserSami::parse(....)
  2. {
  3.   ....
  4.   for (; *s != '>' && *s != '\0'; s++) {
  5.     ;    /* skip remains of non-<P> TAG */
  6.   }
  7.   if (s == '\0') {
  8.     break;
  9.   }
  10.   ....
  11. }
  12.  
  13. This is an example of errors detected indirectly. The programmer actually wanted to check this: if (*s == '\0'). However, this error can be found in a different way through the V528 message.
  14.  
  15. This suspicious code was found in ffdshow project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V595 The 's' pointer was utilized before it was verified against nullptr. tsubreadermplayer.cpp 151
  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